Blockly examples
Moderator: leecollings
-
- Posts: 111
- Joined: Thursday 08 December 2016 9:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Hi Chatjozef,
Thanks for the hint, I thought of this, but it adds extra lines, 7 in total as we cannot work with groups.
It does not solve my problem. I think that blocky is not to intelligent. I have the feeling that every so many seconds the script is run.
So when my motion sensor is triggered lights will go to 50%, then when script runs again, it starts with the first line, stating to switch on lights at 10%, when conditions are met, and that is with all testing I did after approx. 35 seconds.
I will try to split the script into 2 events. One for turning on lights via Dusk Sensor and one for when motion is detected and lights will have to go up to 50% for 2 min.
In general my feeling is that the "set xxxx = yyyy for zz min" is not working as it should.
It there someone out here that has this statement working as it should?
Will LUA overcome the way scripts are handled?
Thanks for the hint, I thought of this, but it adds extra lines, 7 in total as we cannot work with groups.
It does not solve my problem. I think that blocky is not to intelligent. I have the feeling that every so many seconds the script is run.
So when my motion sensor is triggered lights will go to 50%, then when script runs again, it starts with the first line, stating to switch on lights at 10%, when conditions are met, and that is with all testing I did after approx. 35 seconds.
I will try to split the script into 2 events. One for turning on lights via Dusk Sensor and one for when motion is detected and lights will have to go up to 50% for 2 min.
In general my feeling is that the "set xxxx = yyyy for zz min" is not working as it should.
It there someone out here that has this statement working as it should?
Will LUA overcome the way scripts are handled?
-
- Posts: 111
- Joined: Thursday 08 December 2016 9:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
All,
Just split it up in 2 blocky scripts:
one to switch on/off via Dusk sensor: and one to trigger brighter light when motion is detected: Just checked and now light return to 10% after approx. 65 seconds, still 55 short from the 120..
I am not sure anymore Domotics can do what I want (which I believe to be very simple):
Switch light on when Dusk sensor is on and when motion is detected brighten lights to 50% for 2 min.
Help is much appreciated.
Bernard
Just split it up in 2 blocky scripts:
one to switch on/off via Dusk sensor: and one to trigger brighter light when motion is detected: Just checked and now light return to 10% after approx. 65 seconds, still 55 short from the 120..
I am not sure anymore Domotics can do what I want (which I believe to be very simple):
Switch light on when Dusk sensor is on and when motion is detected brighten lights to 50% for 2 min.
Help is much appreciated.
Bernard
-
- Posts: 26
- Joined: Thursday 04 February 2016 13:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.530
- Location: Emmen, Drenthe
- Contact:
Re: Blockly examples
I have created a Selector Switch with 3 values: Day, Evening or Night. A timer has been set which changes the switch's value at sunset, midnight and sunrise.
Now I want to select the correct scene when motion has been detected. A full bright scene during daylight, a relaxed scene in the evening and a low-light scene during nightly hours. Also a virtual switch will be set (with auto-off after 1 hour) to make sure the motion sensor does not overrule a scene which has been manually set.
I have created this blockly script:
However, the script does not work. This is what has been recorded in the log (translated):
2017-09-19 11:24:33.890 Motion in bathroom. Lights "Daglicht" switched off.
2017-09-19 11:24:33.890 Motion in bathroom. Lights "Ontspanning" switched off.
2017-09-19 11:24:33.890 Motion in bathroom. Lights "Boven het bad rood" switched on.
2017-09-19 11:26:33.606 No motion detected in bathroom. Lights will switch off after 1 hour.
As you can see, all scenes will run at the same moment.
I have also tried to use level which does not work either:
Can anyone explain how can I can check the value of a Selector Switch in Blockly?
Now I want to select the correct scene when motion has been detected. A full bright scene during daylight, a relaxed scene in the evening and a low-light scene during nightly hours. Also a virtual switch will be set (with auto-off after 1 hour) to make sure the motion sensor does not overrule a scene which has been manually set.
I have created this blockly script:
However, the script does not work. This is what has been recorded in the log (translated):
2017-09-19 11:24:33.890 Motion in bathroom. Lights "Daglicht" switched off.
2017-09-19 11:24:33.890 Motion in bathroom. Lights "Ontspanning" switched off.
2017-09-19 11:24:33.890 Motion in bathroom. Lights "Boven het bad rood" switched on.
2017-09-19 11:26:33.606 No motion detected in bathroom. Lights will switch off after 1 hour.
As you can see, all scenes will run at the same moment.
I have also tried to use level which does not work either:
Can anyone explain how can I can check the value of a Selector Switch in Blockly?
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Blockly examples
Two important things to remember with Domoticz Blockly implementation. Nested if's do not work and each (else)if-clause in is executed with multiple else-if (and else). So the above needs to be written without the nested if. You are using the correct way to check selector state. When checking the level -> refer to level name; when setting the level -> refer to level value.
Re: Blockly examples
Hello All,
I am running the same blocky configuration for temperature control running on a fresh install of version v3.8153 on a Raspberry PI noobs.
The temperature is coming from the EQ3 Max! lua scripts. In the logs there are no event entries for the two temperature blocky events. When I set a time event it is run without a problem.
Thanks
Chris
I am running the same blocky configuration for temperature control running on a fresh install of version v3.8153 on a Raspberry PI noobs.
The temperature is coming from the EQ3 Max! lua scripts. In the logs there are no event entries for the two temperature blocky events. When I set a time event it is run without a problem.
What could be the cause where can I look to try to get this running?
Thanks
Chris
-
- Posts: 46
- Joined: Friday 12 February 2016 20:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Contact:
Re: Blockly examples
Hi Stanleyk,
try this
IF teplota1 > 10 and teplota1 < 28 and Relay 1 = off
Do Set Relay1 = on
Else if teplota1 > 29 and teplota1 < 50 and Relay 1 = on
Do Set Relay 1 = off
Or
IF teplota1 < 28 and Relay 1 = off
Do Set Relay 1 = on
Else if teplota1 > 29 and Relay 1 = on
Do Set Relay 1 = off
Use the option "Else if" and not the option "if"
Cobra045
try this
IF teplota1 > 10 and teplota1 < 28 and Relay 1 = off
Do Set Relay1 = on
Else if teplota1 > 29 and teplota1 < 50 and Relay 1 = on
Do Set Relay 1 = off
Or
IF teplota1 < 28 and Relay 1 = off
Do Set Relay 1 = on
Else if teplota1 > 29 and Relay 1 = on
Do Set Relay 1 = off
Use the option "Else if" and not the option "if"
Cobra045
Re: Blockly examples
Hallo Cobra,
Thanks for the quick reply Does this look correct? it is also not running.
Thanks in advance
Chirs
Thanks for the quick reply Does this look correct? it is also not running.
Thanks in advance
Chirs
-
- Posts: 46
- Joined: Friday 12 February 2016 20:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Contact:
Re: Blockly examples
Hi Chris68,
I think 19.1 and 22.1 do not work.
First try something simple
Cobra045
I think 19.1 and 22.1 do not work.
First try something simple
Cobra045
-
- Posts: 4
- Joined: Friday 08 September 2017 18:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Is there a blocky way to change te color and brightness settings of my Xiaomi Gateway.
-
- Posts: 24
- Joined: Tuesday 12 September 2017 14:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Yes of course, just add scene and activate it by blocky.
- Attachments
-
- Przechwytywanie.PNG (175.7 KiB) Viewed 14974 times
........................................................................................
RPi2 + sonoff + 433MHz + Xiaomi Gateway + EQ-3 MAX!
RPi2 + sonoff + 433MHz + Xiaomi Gateway + EQ-3 MAX!
-
- Posts: 10
- Joined: Thursday 31 December 2015 16:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Contact:
Re: Blockly examples
Hi,
I have a little problem.
I want to switch the "AutoRaspiRemote_Aktiv"-switch on IF switch "Temp.Test" AND switch "Temp.Test.1" is set to ON.
And if switch "Temp.Test" OR switch "Temp.Test.1" is set to Off, "AutoRaspiRemote_Aktiv"-switch must set to OFF
at first i tried it like the picture below but nothing changed. I also tried it wirt uservariables but nothing happened.
What did I wrong?
I hope someone can help me
Greetings
I have a little problem.
I want to switch the "AutoRaspiRemote_Aktiv"-switch on IF switch "Temp.Test" AND switch "Temp.Test.1" is set to ON.
And if switch "Temp.Test" OR switch "Temp.Test.1" is set to Off, "AutoRaspiRemote_Aktiv"-switch must set to OFF
at first i tried it like the picture below but nothing changed. I also tried it wirt uservariables but nothing happened.
What did I wrong?
I hope someone can help me
Greetings
- Attachments
-
- sw.PNG (11.79 KiB) Viewed 14635 times
-
- Posts: 135
- Joined: Friday 02 January 2015 9:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands
- Contact:
Re: Blockly examples
If you use only one If statement, you'll have to use the other If-block without the blue icon on the top left
-
- Posts: 10
- Joined: Thursday 31 December 2015 16:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Contact:
Re: Blockly examples
Hi,
I have solved my Problem with including the state of "AutoRaspiRemote_Aktiv" in the IF-Question:
IF <Switch.1 is> on AND <Switch.2> is on AND <AutoRaspiRemote_Aktiv> is on THEN SET <AutoRaspiRemote_Aktiv> off
I have solved my Problem with including the state of "AutoRaspiRemote_Aktiv" in the IF-Question:
IF <Switch.1 is> on AND <Switch.2> is on AND <AutoRaspiRemote_Aktiv> is on THEN SET <AutoRaspiRemote_Aktiv> off
-
- Posts: 7
- Joined: Saturday 26 August 2017 21:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Hi,
I'm trying to make Blockly to set "on" my hot water circulation pump(pompa obiegowa) for 2 minutes after PIR (zone:schody) sensor is on, then script should stop pump for next few minutes (for test it is 180sec ).My goal is to get max 1minut of working for 20 minutes.
Unfortunately after first circle system get's some kind a loop and all the time it is seting Var=0 (obiegowa_timer). Mayby someone could find mistake in my blocks?
2017-11-20 23:05:34.178 Set UserVariable obiegowa_timer = 0
2017-11-20 23:05:42.463 Satel Integra: switched output 24 to on
2017-11-20 23:05:44.143 Set UserVariable obiegowa_timer = 0
2017-11-20 23:05:54.176 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:04.134 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:14.298 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:24.214 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:34.179 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:42.355 Satel Integra: switched output 24 to off
2017-11-20 23:06:44.208 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:54.381 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:04.181 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:14.183 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:24.403 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:34.240 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:44.205 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:54.275 Set UserVariable obiegowa_timer = 0
2017-11-20 23:08:04.311 Set UserVariable obiegowa_timer = 0
I'm trying to make Blockly to set "on" my hot water circulation pump(pompa obiegowa) for 2 minutes after PIR (zone:schody) sensor is on, then script should stop pump for next few minutes (for test it is 180sec ).My goal is to get max 1minut of working for 20 minutes.
Unfortunately after first circle system get's some kind a loop and all the time it is seting Var=0 (obiegowa_timer). Mayby someone could find mistake in my blocks?
2017-11-20 23:05:34.178 Set UserVariable obiegowa_timer = 0
2017-11-20 23:05:42.463 Satel Integra: switched output 24 to on
2017-11-20 23:05:44.143 Set UserVariable obiegowa_timer = 0
2017-11-20 23:05:54.176 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:04.134 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:14.298 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:24.214 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:34.179 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:42.355 Satel Integra: switched output 24 to off
2017-11-20 23:06:44.208 Set UserVariable obiegowa_timer = 0
2017-11-20 23:06:54.381 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:04.181 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:14.183 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:24.403 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:34.240 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:44.205 Set UserVariable obiegowa_timer = 0
2017-11-20 23:07:54.275 Set UserVariable obiegowa_timer = 0
2017-11-20 23:08:04.311 Set UserVariable obiegowa_timer = 0
- Attachments
-
- block.JPG (53.3 KiB) Viewed 14400 times
-
- Posts: 11
- Joined: Wednesday 15 November 2017 17:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Aalsmeer
- Contact:
Re: Blockly examples
After some days struggle i hope someone is pointing me into the right direction.
I got a (3)Fibaro Smoke Sensors (FGSD-002) and some Somfy RTS shutters.
In case of Fire i want my shutters open on detection.
Noting is working, even if i change ''panic'' to ''on'
What im i doing wrong here '
I got a (3)Fibaro Smoke Sensors (FGSD-002) and some Somfy RTS shutters.
In case of Fire i want my shutters open on detection.
Noting is working, even if i change ''panic'' to ''on'
What im i doing wrong here '
Last edited by Hempie on Thursday 23 November 2017 22:35, edited 3 times in total.
RFXTRX433E, Aeon Z-Stick Gen 5, Harmony Hub, Nefit Easy, Homebridge, Somfy RTS, Fibaro
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blockly examples
If Rook Alarm = Panic ?
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 11
- Joined: Wednesday 15 November 2017 17:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Aalsmeer
- Contact:
Re: Blockly examples
Rebuild it, this is how i tested it
*post updated
RFXTRX433E, Aeon Z-Stick Gen 5, Harmony Hub, Nefit Easy, Homebridge, Somfy RTS, Fibaro
-
- Posts: 11
- Joined: Wednesday 15 November 2017 17:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Aalsmeer
- Contact:
Re: Blockly examples
Firedetection & open shutters
This seems to be working.
This seems to be working.
RFXTRX433E, Aeon Z-Stick Gen 5, Harmony Hub, Nefit Easy, Homebridge, Somfy RTS, Fibaro
-
- Posts: 135
- Joined: Friday 02 January 2015 9:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands
- Contact:
Re: Blockly examples
I don't think this will work because you have to specify the status of every smoke detector/switch, Blockly won't allow it like the way you did.
It should be:
Code: Select all
If [Rookmelder Hal] = [On] or [Rookmelder Overloop] = [On] or [Rookmelder Zolder] = [On]
Do ...
-
- Posts: 11
- Joined: Wednesday 15 November 2017 17:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Aalsmeer
- Contact:
Re: Blockly examples
Thank you @tozzke i will test this when i'm home.
RFXTRX433E, Aeon Z-Stick Gen 5, Harmony Hub, Nefit Easy, Homebridge, Somfy RTS, Fibaro
Who is online
Users browsing this forum: No registered users and 1 guest