Blockly script not working

Moderator: leecollings

Post Reply
hvb83
Posts: 5
Joined: Tuesday 04 November 2014 13:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Blockly script not working

Post by hvb83 »

I made a blockly script and for some reason it doesn't work, but I cannot find out what I am doing wrong:
Schermafbeelding 2016-07-13 om 22.27.28.png
Schermafbeelding 2016-07-13 om 22.27.28.png (123.71 KiB) Viewed 2159 times
The logfile states the following:
Schermafbeelding 2016-07-13 om 22.28.14.png
Schermafbeelding 2016-07-13 om 22.28.14.png (190.98 KiB) Viewed 2159 times
I'm sure for the experts it's easy to spot, but I cannot figure it out myself. :oops:
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Blockly script not working

Post by Derik »

mmm

What is badkamer... [ looks Light switch.. is that correct? ]
Time must be. xxx OR xxx
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
hvb83
Posts: 5
Joined: Tuesday 04 November 2014 13:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly script not working

Post by hvb83 »

Badkamer is indeed the bathroom light switch, which is supposed to turn the bathroom ventilation and mirror lights/heating on.

I've tried changing AND to OR, but still get the same error.
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 not working

Post by StanHD »

The Badkamer is a dimmer switch? If so, just to test, try using "not = Off".
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
trixwood

Re: Blockly script not working

Post by trixwood »

Time must be. xxx OR xxx
time >= 6.00 or time <= 10.30
is 24 hours...

time >= 6.00 and time <= 10.30
is 4 and 1/2 hours and 1 minute (minus 1 millisecond) between (including) 6.00 and 10.30

fyi.
try using "not = Off".
Confusing... i think you mean:

If it is a switch why check >10%? and not if it's on?

e.g. if badkamer = on and time >= 6.00 and time <= 10.30
hvb83
Posts: 5
Joined: Tuesday 04 November 2014 13:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly script not working

Post by hvb83 »

Sorry for the confusion guys, indeed it is a dimmer and not a switch per say. On another dimmer I found that "if dimmer = on" only triggered above a certain dimmer level, like 30% or more. I therefor figured setting it to 10% would work more reliable in my situation. It's only temporary, until I've figured out why the on/off trigger doesn't work like it is supposed to.

The event is to be true between 6.00 and 10.30, so I think OR was correct.

But that still leaves it a big mystery why I get an error. :D
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 not working

Post by StanHD »

The reason to test "Not = Off" (ie any level except off) is because a dimmer sometimes doesn't respond to "on" or the problem may be with the Level %. So if it works with "Not = Off" then the level % part is the problem, not the time criteria.

This works OK:-

Image

Not an answer to the problem but a possible work around?
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
trixwood

Re: Blockly script not working

Post by trixwood »

I got confused with NOT = Off :-) I interpreted it as 'NOT' = Off (as an identifier not as an operator in programming terms)
never excepted that and read it all wrong! Will include that in [≠, <> or !=] data set ;-)
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 not working

Post by StanHD »

Sorry, my fault I didn't know how to type those characters on my tablet
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
hvb83
Posts: 5
Joined: Tuesday 04 November 2014 13:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly script not working

Post by hvb83 »

Thanks Stan, that did the trick! Now my script is changed in a minor way, but it's working:
Attachments
Schermafbeelding 2016-07-16 om 09.52.49.png
Schermafbeelding 2016-07-16 om 09.52.49.png (112.8 KiB) Viewed 2008 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests