i have tons of email from lots of people requesting different features and upgrades so i thought to have post on site about roadmap/feature requests for PiHome so we can share ideas what we can do and what is needed and how community can help and contribute, right now everything is under one post but once we get things moving we can have one dedicate page for each upgrade.
List of request/features
- Under Floor Heating with Higher Inertia.
- Room thermostat with some small touch LCD screen where you can set temperatures without schedule similar to boost function but without time limit only temperature.
- Add MQTT protocol support to add support for other type of hardware.
Support for MQTT temperature sensors added by paulcsf on Github - Voice control with Google Home support.
- PID Control (i call this weather factor but industry call this PID) for your ref: https://www.eurotherm.com/pid-control-made-easy
- OpenTherm is just over the horizons. all new boilers will be built with this protocol for management.
- Boost/Away Button Console
Initial work completed prototype is in testing. see image link
Completed Tasks
- Weekly Schedule 7-Day Programmable Thermostat.
(Completed on 19/01/2019) Thanks to Terry Adams - Holidays Feature, for set date and time in future when heating will be set to off.
Completed and here is full story link Thanks to Terry Adams - Multi-Language Support
Completed with new update to Dolphin version 1.6 you need to translate languages/en.php to your native language. - Temperature deadband
- E-mail notifications for rare scenarios
On zone fail, sensor battery low, frost protection and over temperature. - Added temperature deadband, zone starts when temperature is below setpoint-deadband and stops when temperature is greater or equal to setpoint.Thanks to aszumski
- Full HVAC System to accommodate North America and all other countries where heating and cooling control is required. Thanks for Terry
- Voice control with Alexa support.
- Some Day to Day improvements are recorded on GitHub for Closed Issues and some Open issues.
Low priority
Modulating the boiler flow temp based on the outside weather/temp
Geo fencing – turning off heat automatically when your not home, turning it back on as you are on your way home, this will required smart phone app to work.
39
39 comments
Hi,
it would be great to be able to control underfloor radiant heating and take into account higher inertia in that system. So it should be able to:
– turn on, off delta T before the temperature should be reached based on inertia (this should be solved by PID regulation I think, that is already on the roadmap)
– use PWM valve actuators to regulate zone output linearly (not only on/off)
Thanks, you are doing a great job and I am happy to help.
Ondrej
@Ondrej
here is link shared by other user for PID control, may be you can find something similar in php.
https://github.com/colinl/node-red-contrib-pid
I know what your are asking: underfloor heating must be treated differently to radiator heating but still PiHome must have some sort of ability to learn how each zone heat-up for both heating systems and time frame.
Code i used previously but then i removed it from boiler.php file while back to factor in weather temperature.
//Get Weather Temperature
$query = "SELECT * FROM messages_in WHERE node_id = '1' ORDER BY id desc LIMIT 1";
$result = $conn->query($query);
$weather_temp = mysqli_fetch_array($result);
$weather_c = $weather_temp['payload'];
// 1 00-05 0.3
// 2 06-10 0.4
// 3 11-15 0.5
// 4 15-20 0.6
$weather_fact = 0;
if ($weather_c <= 5 ) {$weather_fact = 0.2;}elseif ($weather_c <= 10 ) {$weather_fact = 0.3;} elseif($weather_c <= 15 ) {$weather_fact = 0.4;}elseif($weather_c <= 20 ) {$weather_fact = 0.5;}
$zone_c = $zone_c + $weather_fact; //Add to Actual Zone Temperature to Predict Accurate Temperature
Let me know if you can help in anyway or have some algorithm that works in PHP or some library that already doing this.
@Ondrej,
after adding weather factor in my boiler.php i can see slight improvement in achieving target temperature instead going over the target temperature. i have googled PWM valve actuators, but i m little confused here, if i turn off PWM valve the do i need to turn off boiler as well? if i dont turn off boiler then where that pressure/heat will go?
Best would be to integrate also the PID, sorry but had no time to look into it yet if it is available in PHP. Maybe we can find something in Python, most of these controller issues are either solved in Matlab, C or Python. I will get back to you on that.
Normal valve is On/Off, PWM means you switch On/Off so fast you achieve let’s say 65% open. That directly plays along with PID regulation to react to small changes. E.g. in normal state the valve will be 40% open to have 23 degrees and it just reacts to the changes. (https://www.eurotherm.com/pid-control-made-easy)
Probably if all valves are at 0%, we need to turn off boiler, but that can be solved by limiting minimal valve to 10% for example on at least one for now. I mean when you don’t need to heat at all, then you just turn the boiler off anyway.
Hi,
I’ve moved my 7 programable feature on a bit:
1) Added new column WeekDays (smallint) to table schedule_daily_time to store a bit mask for the days of the week
2) Added WeekDays to associated schedule_daily_time_zone_view
3) Added $dow = idate(‘w’); to boiler.php to get the current day number
4) Modified query in boiler.php – $query = “SELECT * FROM schedule_daily_time_zone_view WHERE CURTIME() between
start
ANDend
AND zone_id = {$zone_id} AND time_status = ‘1’ AND (WeekDays & (1 < 0 LIMIT 1;”;5) Modified schedulelist.php to display each bit of WeekDays as a checkbox
6) Modified schedule_add.php and schedulel_edit.php to add checkboxes for each day of the week (copied Enable Schedule code) and update the WeekDays field in schedule_daily_time
I can now have different schedules on different days of the week 🙂
Weekly Schedule 7-Day Programmable Thermostat
@Terry,
that is very short and effective, i m working on bit longer version of this. i will make zip file and share it here so if you want you can contribute, my github knowledge is very limited but may be if possible i can create another branch and do this modification if you or any other user want to contribute to code.
here is Table Structure
CREATE TABLE
schedule_daily_week_days(
idINT(11) NOT NULL AUTO_INCREMENT,
indexTINYINT(4) NOT NULL DEFAULT '0',
syncTINYINT(4) NULL DEFAULT '0',
purgeTINYINT(4) NULL DEFAULT '0',
statusTINYINT(4) NULL DEFAULT '0' COMMENT 'Status of the Day',
weekdayTINYINT(4) NULL DEFAULT '0' COMMENT '1 for Monday, 7 for Sunday)',
idPRIMARY KEY (
)
)
COLLATE='utf16_bin'
ENGINE=InnoDB
AUTO_INCREMENT=7;
CREATE TABLEschedule_daily_time
(
idINT(11) NOT NULL AUTO_INCREMENT,
syncTINYINT(4) NOT NULL DEFAULT '0',
purgeTINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Mark For Deletion',
statusTINYINT(4) NULL DEFAULT '0',
schedule_daily_week_days_idINT(11) NULL DEFAULT NULL,
startTIME NULL DEFAULT NULL,
endTIME NULL DEFAULT NULL,
idPRIMARY KEY (
),
FK_schedule_daily_time_schedule_daily_week_daysINDEX
(
schedule_daily_week_days_id),
FK_schedule_daily_time_schedule_daily_week_daysCONSTRAINT
FOREIGN KEY (
schedule_daily_week_days_id) REFERENCES
schedule_daily_week_days(
id) ON UPDATE NO ACTION ON DELETE NO ACTION
)
COLLATE='utf16_bin'
ENGINE=InnoDB
AUTO_INCREMENT=2;
CREATE TABLEschedule_daily_time_zone
(
idINT(11) NOT NULL AUTO_INCREMENT,
syncTINYINT(4) NOT NULL DEFAULT '0',
purgeTINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Mark For Deletion',
statusTINYINT(4) NULL DEFAULT NULL,
schedule_daily_time_idINT(11) NULL DEFAULT NULL,
zone_idINT(11) NULL DEFAULT NULL,
temperatureTINYINT(4) NULL DEFAULT '0',
idPRIMARY KEY (
),
FK_schedule_daily_time_zone_schedule_daily_timeINDEX
(
schedule_daily_time_id),
FK_schedule_daily_time_zone_zoneINDEX
(
zone_id),
FK_schedule_daily_time_zone_schedule_daily_timeCONSTRAINT
FOREIGN KEY (
schedule_daily_time_id) REFERENCES
schedule_daily_time(
id),
FK_schedule_daily_time_zone_zoneCONSTRAINT
FOREIGN KEY (
zone_id) REFERENCES
zone(
id)
)
COLLATE='utf16_bin'
ENGINE=InnoDB
AUTO_INCREMENT=4;
here is table view : schedule_daily_time_zone_view
select sdt.schedule_daily_week_days_id as sdwd_id, sdwd.
weekday,
statussdt.id as sdt_id, sdt.
as time_status, sdt.
start, sdt.
end,
statussdtz.id as sdtz_id, sdtz.
as sdtz_status, sdtz.zone_id,
purgezone.index_id, zone.name as zone_name, sdtz.temperature
from schedule_daily_time_zone sdtz
join schedule_daily_time sdt on sdtz.schedule_daily_time_id = sdt.id
join schedule_daily_week_days sdwd on sdt.schedule_daily_week_days_id = sdwd.id
join zone on sdtz.zone_id = zone.id
where sdtz.
= '0' order by zone.index_id ;
Great please share to zip as like you my github knowledge is very limited.
By the way might it be better to use php day of the week numbering SUN = 0 to SAT = 6, it might make the php coding simpler
zip file includes gui and sql table structure
http://www.pihome.eu/images/weekly_schedule.zip
Thanks for the zip, I’ve already added the tables and updated the view but I could not see the gui functionality in the schedule php files you provided.
@Terry,
try now, i copied wrong files, make sure you copy css file as well and create table view
Great, thanks got it, working okay I’ll have a play 🙂
Hi,
Thanks for the preview, got it installed and working fine, I think I can see where you are going. Hope you don’t mind if I make a comment:
I guess that the schedules for each day will require an entry in table ‘schedule_daily_time’ with a corresponding entry in table
schedule_daily_week_days
for each day it is active, could this be a bit wasteful. In my case I would run the same schedules on each weekday and a different set of schedules on Sat and Sun, this would create 5 + 2 dupplicate entries in table ‘schedule_daily_time’ (except for the weekday number) for each schedule.My approach only has one set of schedules for all 5 weekdays, plus another set of schedules for the 2 weekend days. Also it does not need a new table to hold the active weekdays as they are stored in a single new ‘mask’ column in table ‘schedule_daily_time.
Just a thought 🙂
@Terry,
all comments are welcome,
schedule_daily_week_days: will only have 7 records 0(Sun) to 6(Sat) for weekdays number,
schedule_daily_time: this will have start and end time with FK to Weekdays table, now this is where i m confused, should i create time for all the days and only enable where user select day or create time for selected days but then on GUI user can see schedule time for each day but for those times as well where user dont need schedule for that day so may be this will become mess and user get confused? on other hand let say user create a schedule for Mon to Fri 7:00 to 8:00 for xyz zone but later user decide i need schedule for sat and sun and add another schedule for those days as well but instead changing/amending exiting schedule user add another schedule.
or second option would be to create schedule time only for selected days so this way it would be neat and clean and user only see created schedule (i m leaning toward this option).
i read your previous comments while i was typing, your choice isn’t bad either infect your choice will have one less table and just amending/adding one extra column for weekdays in schedule_daily_time table is better option, did you modify your gui as well to accommodate days in adding/modifying schedule? can you share it with me?
Hi,
I see where you are going with this, looks good to me 🙂
I’ll email my version to [email protected], please forgive my gui coding, I’m definitely not fluent in php, so just butchered your existing code, I’m sure it can be done better, but at least you can see the approach.
Hi Terry,
sorry for late reply, i been very busy with other things. last night i imported your changes to my development pi and it looks good, i like the way your store the days but on gui side i need to modify few things. i will try to work on this tonight.
PS: using Bitwise Operators never occurred to me 🙁
No problem, glad you thought it of some merit, long time ago I used to program in assembler, hence the leaning towards bit manipulation 🙂
Hi Terry,
i have made some cosmetic changes to 7 days schedule listing. editing, adding and home screen, have hand chance to look at the boiler.php. one thing on home screen manage to show today’s schedule but when user tap to disable that time it will disable all week i think i need to modify that which will be done in db.php file but that next task on 7 days.
http://www.pihome.eu/weekly_schedule_v2.rar
Hi,
Looks good to me, I see what you mean about disabling a schedule on the home screen, not too sure if in fact that action is what you would expect to occur i.e you are disabling a schedule that is allocated across multiple days, hence perhaps the logical outcome should be that the schedule is disabled across all the allocated days, rather than just ‘today’
Hi,
Can you share your button console sketch please
Hi Terry,
sorry for late reply, i was out of country for while.
// _____ _ _ _
// | __ \ (_) | | | |
// | |__) | _ | |__| | ___ _ __ ___ ___
// | ___/ | | | __ | / _ \ | |_ \_ \ / _ \
// | | | | | | | | | (_) | | | | | | | | __/
// |_| |_| |_| |_| \___/ |_| |_| |_| \___|
//
// S M A R T H E A T I N G C O N T R O L
// *****************************************************************
// * Button Console for Boost and Away Function Sensor *
// * Version 0.01 Build Date 06/09/2017 *
// * Have Fun - PiHome.eu *
// *****************************************************************
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
// Set LOW transmit power level as default, if you have an amplified NRF-module and
// power your radio separately with a good regulator you can turn up PA level.
// #define MY_RF24_PA_LEVEL RF24_PA_LOW
#define MY_RF24_PA_LEVEL RF24_PA_MAX
//#define MY_DEBUG_VERBOSE_RF24
// RF channel for the sensor net, 0-127
#define RF24_CHANNEL 91
//RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
#define RF24_DATARATE RF24_250KBPS
// Enabled repeater feature for this node
// #define MY_REPEATER_FEATURE
#include
#include
#include
//PiHome Node ID
#define MY_NODE_ID 40
// Define Relays
#define RELAY_ON 1 // GPIO value to write to turn on attached relay
#define RELAY_OFF 0 // GPIO value to write to turn off attached relay
// Define Sensor ID's
#define SSR_A_ID 1 // Id of the sensor child
#define SSR_B_ID 2 // Id of the sensor child
#define SSR_C_ID 3 // Id of the sensor child
#define SSR_D_ID 4 // Id of the sensor child
// Define buttons and relays
const int buttonPinA = 2;
const int buttonPinB = 3;
const int buttonPinC = 4;
const int buttonPinD = 5;
const int relayPinA = 6;
const int relayPinB = 7;
const int relayPinC = 8;
const int relayPinD = 14; //Analog pin A0 - A5 can be used as digital pins as 14 - 19
// Define Variables
int oldValueA = 0;
int oldValueB = 0;
int oldValueC = 0;
int oldValueD = 0;
bool stateA = false;
bool stateB = false;
bool stateC = false;
bool stateD = false;
int trigger = 0;
Bounce debouncerA = Bounce();
Bounce debouncerB = Bounce();
Bounce debouncerC = Bounce();
Bounce debouncerD = Bounce();
MyMessage msgA(SSR_A_ID, V_STATUS);
MyMessage msgB(SSR_B_ID, V_STATUS);
MyMessage msgC(SSR_C_ID, V_STATUS);
MyMessage msgD(SSR_D_ID, V_STATUS);
void setup()
{
pinMode(buttonPinA, INPUT_PULLUP); // Setup the button Activate internal pull-up
pinMode(buttonPinB, INPUT_PULLUP); // Setup the button Activate internal pull-up
pinMode(buttonPinC, INPUT_PULLUP); // Setup the button Activate internal pull-up
pinMode(buttonPinD, INPUT_PULLUP); // Setup the button Activate internal pull-up
// After setting up the buttons, setup debouncer
debouncerA.attach(buttonPinA);
debouncerA.interval(5);
debouncerB.attach(buttonPinB);
debouncerB.interval(5);
debouncerC.attach(buttonPinC);
debouncerC.interval(5);
debouncerD.attach(buttonPinD);
debouncerD.interval(5);
// Make sure relays are off when starting up
digitalWrite(relayPinA, RELAY_OFF);
digitalWrite(relayPinB, RELAY_OFF);
digitalWrite(relayPinC, RELAY_OFF);
digitalWrite(relayPinD, RELAY_OFF);
// Then set relay pins in output mode
pinMode(relayPinA, OUTPUT);
pinMode(relayPinB, OUTPUT);
pinMode(relayPinC, OUTPUT);
pinMode(relayPinD, OUTPUT);
}
void presentation() {
sendSketchInfo("Button Console", "1.31");
present(SSR_A_ID, S_LIGHT);
present(SSR_B_ID, S_LIGHT);
present(SSR_C_ID, S_LIGHT);
present(SSR_D_ID, S_LIGHT);
}
//Example on how to asynchronously check for new messages from gw
void loop()
{
if (trigger == 0){
send(msgA.set(false)); // Send off state for relayA to ensure controller knows the switch is off
send(msgB.set(false)); // Send off state for relayB to ensure controller knows the switch is off
send(msgC.set(false)); // Send off state for relayC to ensure controller knows the switch is off
send(msgD.set(false)); // Send off state for relayD to ensure controller knows the switch is off
trigger = 1;
}
//Button One
debouncerA.update();
// Get the update value
int valueA = debouncerA.read();
if (valueA != oldValueA && valueA == 0) {
send(msgA.set(stateA ? false : true), true); // Send new state and request ack back
}
oldValueA = valueA;
//Button Two
debouncerB.update();
// Get the update value
int valueB = debouncerB.read();
if (valueB != oldValueB && valueB == 0) {
send(msgB.set(stateB ? false : true), true); // Send new state and request ack back
}
oldValueB = valueB;
//Button Three
debouncerC.update();
// Get the update value
int valueC = debouncerC.read();
if (valueC != oldValueC && valueC == 0) {
send(msgC.set(stateC ? false : true), true); // Send new state and request ack back
}
oldValueC = valueC;
//Button Four
debouncerD.update();
// Get the update value
int valueD = debouncerD.read();
if (valueD != oldValueD && valueD == 0) {
send(msgD.set(stateD ? false : true), true); // Send new state and request ack back
}
oldValueD = valueD;
}
void receive(const MyMessage &message) {
// We only expect one type of message from controller. But we better check anyway.
if (message.type == V_STATUS) {
switch (message.sensor) {
case 1:
stateA = message.getBool();
// child sensors id + number to get LED Pin number
digitalWrite(message.sensor + 5, stateA ? RELAY_ON : RELAY_OFF);
break;
case 2:
stateB = message.getBool();
// child sensors id + number to get LED Pin number
digitalWrite(message.sensor + 5, stateB ? RELAY_ON : RELAY_OFF);
break;
case 3:
stateC = message.getBool();
// child sensors id + number to get LED Pin number
digitalWrite(message.sensor + 5, stateC ? RELAY_ON : RELAY_OFF);
break;
case 4:
stateD = message.getBool();
// child sensors id + number to get LED Pin number. Analog pin A0 - A5 can be used as digital pins as 14 - 19
digitalWrite(message.sensor + 10, stateD ? RELAY_ON : RELAY_OFF);
break;
}
#ifdef MY_DEBUG
//Write some debug info
Serial.print("Incoming change for Sensor: ");
Serial.println(message.sensor);
Serial.print("From Node: ");
Serial.println(message.sender);
Serial.print("New status: ");
Serial.println(message.getBool());
#endif
}
}
Great thanks for that, it will be useful.
regards
terry
The new changes for the dayli schedule are not on Github. Is there a reason? Are you still working?
yes, this change isn’t available in Github. i m not finished with testing.
Hi,
Maybe expand the wired system with 1-wire switch devices. I use some relayboard same this: http://denkovi.com/1-wire-eight-channel-relay-board-for-home-automation
for sprinkler system and the floor heating zones
Thanx
Gus
Gusthy,
Thank you for your suggestion, Do you have code (preferably PHP or Python) to send commands to 1-Wire relay board?
In this time i use HomeSeer 2.x on windows Asus VivoMini Pc, but i like to change something smallest for 7*24 control, but i see on denkovi site owfs and same system control . I gues its sample read 1-wire id and read addressed register and write to addressed device register commands use
I found some ideas for another 1-wire devices.
controlling-relay-board-with-ds2408-over-1-wire
so i guess i buy one ds2482 I2C/1-wire bus master and try to control relay boards over I2C
ak-ds2482s-100
Hi All,
7 Days Schedule now available to download from GitHub, i m still testing this so report back any bugs/issues please and thank to Terry Adams for contributing this code.
Hi,
How about a pop-up confirmation on both the Shutdown and Reboot settings buttons as a precaution.
Note that the existing shutdown and reboot commands do not work on my system, due to privileges issue. fixed by adding to sudoers:
www-data ALL=NOPASSWD:/sbin/shutdown
www-data ALL=NOPASSWD:/sbin/reboot
Hi Terry,
thank you for pointing out but this part is defined separately in Enable Reboot/Shutdown RPI from Web
Ooops sorry did not pick that up, just reinvented the wheel 🙂
Version 1.6 Dolphin is here.
Multi language support, all you need is to make copy of /language/en.php and translate it into your local language.
Schedule temperature drop down changed to slider,
Support added for Boost Console hardware.
Where is here? 🙂
at this point and time its only on github and i m working on sd card image. 🙂
thx for fast answer
Hi,
First of all thank you for an amazing system that looks very promising and hopefully has a bright future. I have a relatively simple feature request that I would find to be of great benefit. I would like to see an input for a humidity sensor (such as DHT11 etc.) and the ability to switch on an extractor fan or to boost a MHRV system via a relay channel.
Ventilation fans with built in humidistats are, in my experience, largely unreliable and very hit-and-miss with their interpretation of the room’s humidity level. Having used the DHT11 and AM2301 sensors for various environmental projects they seem to be very reliable and very accurate.
Fans which simply operate when the room light is switched on waste energy and remove warm air from the room unnecessarily. Not to mention how annoying the noise can be when activated in the middle of the night!
Another option that you may add to increase functionality further is to add a boost button input. A momentary switch could be used to activate the fan for a period of time even if the humidity level is below the trigger level. This could be useful in removing odours from the room etc.
Thanks again for the great project.
Paulo.
Hi Paulo,
thank you for your kind comments, i have similar request from other user but no further details. if you have time we can have further conversation on how MHRV system works and what are the expectations and requirements. in one line i don’t know who MHRV system works, how to control it. so if you can teach me or make me understand i can add this in PiHome.
Hi,
Apologies for my long delay in getting back to you. The MVHR (the correct acronym, it’s not MHRV as I previously wrote – which stands for mechanical ventilarion with heat recovery) is a system of continuous ventilation which is ducted to each room of the house. The “wet” rooms (such as kitchen, bathroom, laundry etc.) have air extraction while the other rooms have air ventilation. The moist extracted air is ducted to the MVHR unit which then purges the air outdoors. The clever part is that on it’s way through the MVHR unit it passes through a heat exchanger which removes most of the heat energy and transfers it in to incoming fresh air (from outdoors) which is then ducted to the ventilated rooms of the house.
The net result of this is that there is a complete change of air in the house several times every day which avoids problems with damp and mould and makes for a much more pleasant living environment. The units cost very little to run and the benefits are many.
Many MVHR units have built in humidity sensors so as the extracted air is passing through the unit it detects the moisture level and will boost the fan speeds to remove the humidity from the room. However, some do not have this feature and some units have it but it doesn’t work very well, so it would be useful to be able to incorporate accurate humidity sensors from several rooms into the system to boost the fans when required.
That said, what I would really like to see in PiHome is the ability to control standard extraction fans based upon the humidity level in the room. I have a fan in the bathroom which is activated when the light is switched on so each time someone switches on the bathroom light hundreds of litres of warm air is extracted from the room regardless of whether the fan is required or not. I could control the fan manually with a separate switch but that means that people could leave it on indefinately and waste even more heated air, and let’s face it we’re geeks, why do something manually when we can automate it! 🙂
Most fans have a mains level switching (although more LV models are coming on the market) so as I see it the Pi would need a humidity input from a DHT11 (or similar), when a threshold is reached the fan is activated via a relay or contactor, the humidity continues to be monitored every few seconds and when the humidity level drops below the threshold again it shuts off the fan again.
From an environmental perspective this would be great as the fan would only run when it’s required and for only as long as it’s required so there’s no wasted energy to run the fan and most of all there’s the minimum of warm air extracted from the room.
As I said in my previous post, many fans are available with a humidistat but in my experience they are inaccurate and unreliable. I have been using DHT11s for years and have yet to have one fail on me.
I hope that this helps, if I can help further please let me know as I am keen to get behind a project like PiHome and help out where I can.
Paulo.