Hi All,
I've tried a number of different methods to do this, and they have all failed!
I would like to be able to control the temperature of our guest bedroom with a toggle switch on the FHEM webpage, controlling a dummy variable "Guest". So, if we don't have a guest, I set the switch to "no" and the temperature is set to around 12 degrees. If we have a guest, the switch is set to "yes" and I have a variable profile depending upon the time of day. I thought this would work:
define HeatGuestS_NG Heating_Control Guest_Small 1234567|00:00|12 (ReadingsVal("Guest", "STATE", "no") eq "no")
define HeatGuestS_G Heating_Control Guest_Small 12345|04:00|19.5 07:00|16 19:00|19.5 22:00|16 67|07:00|19.5 09:30|16 16:00|19.5 23:00|16 (ReadingsVal("Guest", "STATE", "no") eq "yes")
but it didn't appear to. I then tried wrapping the 2 definitions in a loop that was called periodically. This didn't work either.
What's the correct way to make a heating_control dynamic?
Thanks
Homer
OK, I have it working like this....
define HeatGuestL Heating_Control Guest_Large 1234567|12:00|11
define HeatGuestS Heating_Control Guest_Small 1234567|12:00|11
attr HeatGuestL room Heating
attr HeatGuestS room Heating
define DoWeHaveGuests at +*00:01:00 {\
if (Value("Guest") ne "yes") {fhem("delete HeatGuestL;; define HeatGuestL Heating_Control Guest_Large 1234567|12:00|12;; attr HeatGuestL room Heating;; delete HeatGuestS;; define HeatGuestS Heating_Control Guest_Small 1234567|12:00|12;; attr HeatGuestS room Heating;;")}\
else {fhem("delete HeatGuestL;; define HeatGuestL Heating_Control Guest_Large 12345|04:00|19.5 07:00|16 19:00|19.5 22:00|16 67|07:00|19.5 09:30|16 16:00|19.5 23:00|16;; attr HeatGuestL room Heating;; delete HeatGuestS;; define HeatGuestS Heating_Control Guest_Small 12345|04:00|19.5 07:00|16 19:00|19.5 22:00|16 67|07:00|19.5 09:30|16 16:00|19.5 23:00|16;; attr HeatGuestS room Heating;;")}\
}
... but hopefully there's a more concise/elegant way?
Homer