Hi there.
I tried creating a blockly script to make my lights turn on if the alarm is in the on state. My alarm is a simple threeway switch ("On", "Off", "Home on"), as I have not found a way to change the "armed" state of my home using a switch.
My current blockly looks like this. None of the events are ever triggered.
My devices look like this
Can anyone suggest how to fix the problem or suggest a Lua script alternative?
Could timers on a switch be conditional e.g. if "Alarm=On" the timer is active else it is not?
Blockly to switch lights when alarm = On
Moderators: leecollings, remb0
Re: Blockly to switch lights when alarm = On
Hi,
the first line states ".... and Alarm = "On" "
A selector has numeric values, i.e. 0 for Off, 10 for Level1, etc. So I think your blockly needs to check not if it is "On" but if it is "10". And I expect it not to be text (that is not between quotes) but as a number.
I should test it before I post something here.
It works with the text blockly, so I need to investigate it some more.
Did you choose the blockly to be "Device" or "Time"? When I test it as Device, it doesn't work, but as Time it will.
the first line states ".... and Alarm = "On" "
A selector has numeric values, i.e. 0 for Off, 10 for Level1, etc. So I think your blockly needs to check not if it is "On" but if it is "10". And I expect it not to be text (that is not between quotes) but as a number.
I should test it before I post something here.
It works with the text blockly, so I need to investigate it some more.
Did you choose the blockly to be "Device" or "Time"? When I test it as Device, it doesn't work, but as Time it will.
-
- Posts: 15
- Joined: Wednesday 18 May 2016 5:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly to switch lights when alarm = On
Thanks. I had my script set to "Both". I tried modifying it to time but it still did not work.
I got it working by adding an extra and testing if a light was off or on in each of the statements.
I got it working by adding an extra and testing if a light was off or on in each of the statements.
-
- Posts: 94
- Joined: Monday 30 November 2015 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly to switch lights when alarm = On
If Alarm is a multi selector, you need to set it as 0, 10 or 20.
You can also look at my blockly:
http://domoticz.com/forum/viewtopic.php ... 043#p71013
You can also look at my blockly:
http://domoticz.com/forum/viewtopic.php ... 043#p71013
Who is online
Users browsing this forum: Bing [Bot] and 1 guest