Blockly: Alarm function not working

Moderator: leecollings

Post Reply
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Blockly: Alarm function not working

Post by Mace »

I'm trying to get a simple 'alarm' function working with Blockly.
Hardware used:
Xiaomi Motion Sensors
Xiaomi Gateway 2

Switches (virtual) used:
Is Dark Switch (On= 1 minute after sunset, Off= 1 minute after sunrise)
Motion LR Detected (On when at least 1 motion detector detects movement, Off when no movement is reported by all motion sensors)

Usecase:
I want to get an alarm notification and switch the light on the Gateway on for 5 minutes, if motion is detected by either Motion Sensor and it is after dark.

Blockly's:

Motion detection:
Motion Detection.PNG
Motion Detection.PNG (31.91 KiB) Viewed 1026 times
Alarm:
Alarm.PNG
Alarm.PNG (25.8 KiB) Viewed 1026 times
The 'Is Dark Switch' and 'Motion Detected LR' are working fine and trigger on and off at the right times, but alarm isn't triggered.

I've chosen for the 'Device' setting for both blocklys, can't imagine that's not the right setting.

Any one that can help me?
mrf68

Re: Blockly: Alarm function not working

Post by mrf68 »

I think the Alarm blockly has the wrong if/do block. It looks like you used the if/then/else if block, but in this case you need the other one without the else/if possibility.
Mace
Posts: 65
Joined: Monday 21 August 2017 19:52
Target OS: Windows
Domoticz version: 3.8153
Location: Rhoon
Contact:

Re: Blockly: Alarm function not working

Post by Mace »

Thanks.....stupid mistake...Shame on me.... ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest