Page 1 of 1

Calling levels / niveau by Blockly

Posted: Tuesday 03 December 2019 11:34
by bartmolk
Hello guys,

I was wondering if it is possible to call / set the level or niveau on blockly by adding some kind of variable to the block? I have a XIaomi gateway which I want to be activated whenever someone walks by for example I have added my script been searching and trying to figure out how this was able to be fixed.

Can't seem to figure out how this could be fixed. Let me know if someone has information please. Thanks in advance!

Re: Calling levels / niveau by Blockly

Posted: Tuesday 03 December 2019 12:44
by bartmolk
Okay, I did find out how to set the alarm to a certain level now which goes by creating a new switch which I have named 'alarm-set-geluid' I can loop the sound for a certain amount of time but I can't set it to keep looping untill the alarm has been turned off the switch uses the following command at this moment:

Code: Select all

http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=31&switchcmd=Set%20Level&level=30
But is it also possible to get the sound in a permanent loop untill it has been deactivated, for example this I what I am testing with now..

Re: Calling levels / niveau by Blockly

Posted: Friday 20 December 2019 17:29
by wouterlet
Maybe you can make a dummy switch?
In the "If" and "dummy = off"
in the "Do" set "dummy = on"

Then make an "else if" and make it like:

"If" "dummy = on"
"Do" "set dummy off after 6 sec"

And another "else if" to reset the dummy if the alarm is off:
"If" "alarm = off"
"Do" "set dummy off"

Something like this maybe?