Page 1 of 1

Thermostat Control with Blockly - need help please

Posted: Wednesday 10 January 2018 21:47
by stefanwo
Hi everybody,
I hope someone could help me, please.
I try to controll my thermostats depending on presence and time.
The two switches "StefanHome" and "SimoneHome" are both controlled by the geofence in the android app. The Switch "Zeitschaltung" is a timer controlled virtual switch which is on between 6 oclock 23.30 oclock.
What it should do: If one of us is at home (Simone / StefanHome is on), and its between 0600 and 2330 ("Zeitschaltung" is on) the thermostat "Wohnzimmerheizung" should set to 23degrees if its between 0530 and 0700, and set to 22 degrees if its between 0701 and 0200 oclock and "Küchenheizung" set to 19 degrees. To control that it works a message should be send.
And this first part works. (please read second post) But the Second part does not.
In this part it should do the following. If both of us arent at home (SimoneHome and StefanHome is off) OR its between 2331 and 0559 ("Zeitschaltung" is off) it should set the thermostats to 17 respectively 15 degrees and send annother message for testing matters.
So for example SimoneHome and Zeitschaltung are "ON" it set the two thermostats to right setting, but if i switch Zeitschaltung to off, it doesnt set the thermostats to 17/15 degrees nor sending the message.
What iam doing wrong? Where is my failure.
I hope anybody could please help me with this.

Now i found a second failure. It doesnt matter what time it is the thermostat "Wohnzimmer" is at first set to 23 degrees and then to 22 degrees instant.
2018-01-10 21_24_05-Domoticz.png
2018-01-10 21_24_05-Domoticz.png (49.7 KiB) Viewed 1730 times
PS: I know my english is not the best, as you can see its not my native language, but i hope you understand what i try to explain. :?

Re: Thermostat Control with Blockly - need help please

Posted: Wednesday 10 January 2018 22:16
by stefanwo
Ok sorry for disturbing that much. For test purposes i changed the event to this:
2018-01-10 22_12_13-Domoticz.png
2018-01-10 22_12_13-Domoticz.png (53.51 KiB) Viewed 1723 times
The two new switches "Morgens" and "Resttag" are time controlled virtual switches. The problem is, despite the fact that "Morgens" is off the thermostat is set to 23 degrees and instant after that to 22 degrees (and send both messages). So it seems that the embedded if-elseif is not tested and both assignement are set.

The second part of the main if (elseif) is still not working

Thank you so much in advance!

Re: Thermostat Control with Blockly - need help please

Posted: Thursday 11 January 2018 18:33
by StanHD
Hi, the basic problem is probably that nested "If" blocks do not work. Try re-building without the nesting?

Re: Thermostat Control with Blockly - need help please

Posted: Friday 12 January 2018 6:23
by stefanwo
Yeah, it seems that the nested parts were the problem. I split the whole block into two seperate parts and change the second part to one if-else-if block. Now it works like a charme.
Thanks a lot for the advice. I didnt know that netsted if dont work in blockly. :oops: