Blockly examples
Moderator: leecollings
-
- Posts: 28
- Joined: Thursday 02 March 2017 11:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Thanks for your quick response, will try this!
-
- Posts: 85
- Joined: Monday 17 August 2015 21:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
I don't know if this has been answered already but I did not find it. What is the best way to create this scenario from using a motiondetector/PIR with a lamp.
1.When movement is detected lamp is turned on for 10 min.
2. if movement is detected when the lamp is on then the timer is reset to 10min again
Last time I tried I used the "set x = y after z seconds" and also "set x = y for z minutes" and I also tried using blocky to change a user variable from 0 to 1 in different ways. But none of them worked as expected. They always flicker when the previous timer ended even as the new timer where supposed to have started.
1.When movement is detected lamp is turned on for 10 min.
2. if movement is detected when the lamp is on then the timer is reset to 10min again
Last time I tried I used the "set x = y after z seconds" and also "set x = y for z minutes" and I also tried using blocky to change a user variable from 0 to 1 in different ways. But none of them worked as expected. They always flicker when the previous timer ended even as the new timer where supposed to have started.
- EdddieN
- Posts: 510
- Joined: Wednesday 16 November 2016 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: Scotland
- Contact:
Re: Blockly examples
I think you may need to use some script for it... have you tried to trigger your event with a timer instead with a device? That way as far as the switch is ON it will keep resetting 10 minutes?
11101101 - www.machinon.com
- EdddieN
- Posts: 510
- Joined: Wednesday 16 November 2016 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: Scotland
- Contact:
Re: Blockly examples
Is it possible to trigger a shell script after X seconds via blockly?
11101101 - www.machinon.com
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
This is my blocky:
if time it's more than 21 and my playstation 4 is on, it active a scene that switch off all lights in the home and switch on the light near tv.
But now I have a question; I see the log and this blocky runs every 2 minutes more or less, so there is no risk of ruining the light bulbs that receive continuous commands?
Thanks
if time it's more than 21 and my playstation 4 is on, it active a scene that switch off all lights in the home and switch on the light near tv.
But now I have a question; I see the log and this blocky runs every 2 minutes more or less, so there is no risk of ruining the light bulbs that receive continuous commands?
Thanks
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
- EdddieN
- Posts: 510
- Joined: Wednesday 16 November 2016 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: Scotland
- Contact:
Re: Blockly examples
You could add a variable to let
Know Domoticz that event has run and no need to keep issuing commands to the lights.
A bit like: if PS4 and >21 and userVar = 0 then
Switch on light and set userVar=1
Just make sure to reset userVar to zero when no longer the event applies.
Hope it helps
Know Domoticz that event has run and no need to keep issuing commands to the lights.
A bit like: if PS4 and >21 and userVar = 0 then
Switch on light and set userVar=1
Just make sure to reset userVar to zero when no longer the event applies.
Hope it helps
11101101 - www.machinon.com
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
How is possible to reset var to 0?
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
corederoma82 wrote: ↑Friday 24 August 2018 22:30 How is possible to reset var to 0? Oh and what is Uservar?
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
- EdddieN
- Posts: 510
- Joined: Wednesday 16 November 2016 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: Scotland
- Contact:
Re: Blockly examples
A bit like: if PS4 and >21 and userVar = 0 then
Switch on light and set userVar=1
Else if PS4=off and/or.... (whatever) and userVar=1 then
Whatever you want to do and see userVar=0
11101101 - www.machinon.com
- EdddieN
- Posts: 510
- Joined: Wednesday 16 November 2016 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Location: Scotland
- Contact:
Re: Blockly examples
UserVar is a user variable, look under setup menu, there’s an option under more options
11101101 - www.machinon.com
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Done, but script says : Error: EventSystem: Lua script error (Blockly), Name: Playstation_Accesa_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: ')' expected near 'comparevariable'
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
- gijsje
- Posts: 132
- Joined: Saturday 19 August 2017 14:28
- Target OS: NAS (Synology & others)
- Domoticz version: Stable
- Location: Berkel Enschot, NL
- Contact:
Re: Blockly examples
You can also do in the first line IF tv=off and time........................
Then it will not start it again because the tv is already on
Then it will not start it again because the tv is already on
Synology DS218+ - RFXtrx433 - Aeotec Z-Stick Gen5 - Toon Thermostat - Neo CoolCam plug - Neo CoolCam PIR - FIBARO PIR - Heiman Smart Smoke Senso - Neo CoolCam Leakage Detector - BeNext Tag Reader - P1 and S0 USB - many Mi-Light lights - KAKU switches
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
???
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
What I wrong?
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Blockly examples
You cannot do a SET Salone = Off And ...
This needs to be 2 separate set rows, one for the Swich and one for the variable.
Jos
This needs to be 2 separate set rows, one for the Swich and one for the variable.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
How is possible create 2 separate set rows?
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Blockly examples
Just drag and drop 2 separate set command.... as simple as that!.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 85
- Joined: Saturday 14 January 2017 21:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Done!!!!! It seems to work properly.
Thanks very much guys
Thanks very much guys
Raspberry PI 3, 3x Yeelight bulbs, 1x Yeeligh led strip, 1x Sonoff with ESP826, Controlicz, Kodi
-
- Posts: 1
- Joined: Wednesday 12 September 2018 22:30
- Target OS: -
- Domoticz version:
- Contact:
Re: Blockly examples
Hi,
Just new Here. Allard is my name.
I try to make this work;
But it is not working, nothing happens.
Activating buttons in the switch window will work Well and the PIR also shown active with any movement.
In Domoticz setup the events button is active.
Any idears?
Thanks, Allard
Verzonden vanaf mijn iPad met Tapatalk
Just new Here. Allard is my name.
I try to make this work;
But it is not working, nothing happens.
Activating buttons in the switch window will work Well and the PIR also shown active with any movement.
In Domoticz setup the events button is active.
Any idears?
Thanks, Allard
Verzonden vanaf mijn iPad met Tapatalk
Who is online
Users browsing this forum: No registered users and 0 guests