Blockly script doesn't work

Moderator: leecollings

Post Reply
bkrajnc
Posts: 6
Joined: Tuesday 04 July 2017 20:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Blockly script doesn't work

Post 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 1785 times
Blockly
logic
logic
ScreenHunter_305 Jul. 04 19.57.jpg (114.65 KiB) Viewed 1785 times
I think this should work but it doesn't. What I am doing wrong?
Any advice would be helpfull
THX
bkrajnc
Posts: 6
Joined: Tuesday 04 July 2017 20:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly script doesn't work

Post by bkrajnc »

.....realy nobody knows ?
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Blockly script doesn't work

Post 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
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly script doesn't work

Post 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.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
bkrajnc
Posts: 6
Joined: Tuesday 04 July 2017 20:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly script doesn't work

Post by bkrajnc »

Many thanks to all. I will check tomorow when I come from holidays ;)
bkrajnc
Posts: 6
Joined: Tuesday 04 July 2017 20:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly script doesn't work

Post by bkrajnc »

It works like I expected ;-)

Once again, many thanks for both of answers
Boris
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest