Page 1 of 1

Blockly script doesn't work

Posted: Tuesday 04 July 2017 20:16
by bkrajnc
Hi all
I have dht22 and switch/relay connected on esp8266. When I enable/disable switch in domoticz everything works fine, relay turns on or off. Now I try with Blockly logic. I would like to enable switch when the temperature measured with dht22 is equal or higher than 31 degrees and turn off when temperature is lower than 29 degrees.
Switch configuration
Switch configuration
ScreenHunter_302 Jul. 04 18.58.jpg (151.39 KiB) Viewed 1788 times
Blockly
logic
logic
ScreenHunter_305 Jul. 04 19.57.jpg (114.65 KiB) Viewed 1788 times
I think this should work but it doesn't. What I am doing wrong?
Any advice would be helpfull
THX

Re: Blockly script doesn't work

Posted: Tuesday 11 July 2017 12:43
by bkrajnc
.....realy nobody knows ?

Re: Blockly script doesn't work

Posted: Tuesday 11 July 2017 17:19
by dressie
Ad the state of the switch in the first line, so if temp=31 and switch is off set switch on.

Verstuurd vanaf mijn SM-G920F met Tapatalk

Re: Blockly script doesn't work

Posted: Thursday 13 July 2017 18:06
by StanHD
I think this cannot work because:-

1. You have used an "If / Else If" block without an Else If. This will not work, use the other "If " block without the blue gear symbol.
2. You have joined 2 of these together. This will not work either.

Try to redo this with a single If / Else If block something like:-

If living room temp > 30 and Relay = Off
Do set Relay = On
Else If living room temp < 30 and Relay = On
Do set Relay = Off

Hope that helps.

Re: Blockly script doesn't work

Posted: Thursday 13 July 2017 18:48
by bkrajnc
Many thanks to all. I will check tomorow when I come from holidays ;)

Re: Blockly script doesn't work

Posted: Friday 14 July 2017 19:57
by bkrajnc
It works like I expected ;-)

Once again, many thanks for both of answers
Boris