Blockly examples
Moderator: leecollings
-
- Posts: 187
- Joined: Tuesday 07 March 2017 21:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Germany
- Contact:
Re: Blockly examples
I can do it, how can I convert it to a code like you did above?
-
- Posts: 187
- Joined: Tuesday 07 March 2017 21:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Germany
- Contact:
Re: Blockly examples
- Attachments
-
- sshot-2019-05-07-[1].jpg (112.64 KiB) Viewed 5667 times
-
- Posts: 11
- Joined: Friday 25 October 2019 22:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Vlaardingen
- Contact:
Re: Blockly examples
I am just getting started using blockly and i need some help.
I want to turn-off the heater when the door is open for longer than 30 seconds.
If the door is closed I would like the heater to return to the state that it was in before opening the door.
There is an option On / Off but no resume. What can I do?
I want to turn-off the heater when the door is open for longer than 30 seconds.
If the door is closed I would like the heater to return to the state that it was in before opening the door.
There is an option On / Off but no resume. What can I do?
-
- Posts: 187
- Joined: Tuesday 07 March 2017 21:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Germany
- Contact:
Re: Blockly examples
Which values does the heater still have? Only on and off, or even temperature?
-
- Posts: 11
- Joined: Friday 25 October 2019 22:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Vlaardingen
- Contact:
Re: Blockly examples
Only on or off, maybe a temperature. I would like to use the automation year round. During the summer the heater is off and shoud stay off.
But during the winter the heater should resume what it is doing.
But during the winter the heater should resume what it is doing.
-
- Posts: 187
- Joined: Tuesday 07 March 2017 21:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Germany
- Contact:
Re: Blockly examples
You can try to create a Virtual Thermostat.
There you can enter the IDX for schlater and temperature.
https://www.domoticz.com/wiki/Plugins/S ... ostat.html
There you can enter the IDX for schlater and temperature.
https://www.domoticz.com/wiki/Plugins/S ... ostat.html
-
- Posts: 70
- Joined: Friday 21 September 2018 18:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: Blockly examples
How to use Push off button in Blocky.
I have two on/off buttons which work. I have a remote with All Off button. This off button is "Type: Light/Switch, AC, Push Off Button" in Domoticz. If I press All Off on remote or Push Off button in Domoticz swhitches turn off but the state in Domoticz is still on.
How Can I use that Push Off button to whitch off also the switches in Domoticz? I have tries if that Push off Button is off, on, 1 and 0 but nothing happens.
I have two on/off buttons which work. I have a remote with All Off button. This off button is "Type: Light/Switch, AC, Push Off Button" in Domoticz. If I press All Off on remote or Push Off button in Domoticz swhitches turn off but the state in Domoticz is still on.
How Can I use that Push Off button to whitch off also the switches in Domoticz? I have tries if that Push off Button is off, on, 1 and 0 but nothing happens.
-
- Posts: 3
- Joined: Friday 05 April 2019 21:05
- Target OS: -
- Domoticz version:
- Contact:
Re: Blockly examples
Hi, I am trying to resolve a task with blockly: If a PIR is off FOR some time do action. Is it just me finding this impossible to solve?
-
- Posts: 170
- Joined: Monday 22 January 2018 21:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
I use this plugin for that purpose:
https://www.domoticz.com/forum/viewtopic.php?t=23813
Countdown is triggered by my PIR sensor. If countdown is still counting, and PIR is going on, countdown is starting over again (I think this is different from using a switch with delay?).
https://www.domoticz.com/forum/viewtopic.php?t=23813
Countdown is triggered by my PIR sensor. If countdown is still counting, and PIR is going on, countdown is starting over again (I think this is different from using a switch with delay?).
- Attachments
-
- blocky.png (71.74 KiB) Viewed 3999 times
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
Zwave, Zigate, RFlink etc.
-
- Posts: 3
- Joined: Friday 05 April 2019 21:05
- Target OS: -
- Domoticz version:
- Contact:
Re: Blockly examples
Thank you, seems to be addressing the task, not an easy to resolve in blockly otherwise.Geitje wrote: ↑Monday 09 December 2019 23:12 I use this plugin for that purpose:
https://www.domoticz.com/forum/viewtopic.php?t=23813
Countdown is triggered by my PIR sensor. If countdown is still counting, and PIR is going on, countdown is starting over again (I think this is different from using a switch with delay?).
-
- Posts: 20
- Joined: Sunday 30 December 2018 19:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Oss NL
- Contact:
Re: Blockly examples
is it possible in blockly to trigger on user variables?
if i make a example: The Alarm variable changes to 1.
But the alarm switch stays off, and the variable doesn't change back to 0.
even if i split up the 2 parts en set the trigger of the second part to "User variable"
The second part doesn't seem to be triggered.
if i make a example: The Alarm variable changes to 1.
But the alarm switch stays off, and the variable doesn't change back to 0.
even if i split up the 2 parts en set the trigger of the second part to "User variable"
The second part doesn't seem to be triggered.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Blockly examples
Yes
Loglines
Code: Select all
2020-01-04 01:55:46.157 EventSystem: Event triggered: Blockly uservariable_1
2020-01-04 01:55:46.157 Status: Variable triggered
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 40
- Joined: Friday 24 February 2017 21:20
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Blockly examples
That does not work.
Blokly and lua and dzVents wil not trigger in a variable that is changed via scripts of blockly.
They will only trigger if the variable is changed via the web interface of via json.
That is to prevent loops
Blokly and lua and dzVents wil not trigger in a variable that is changed via scripts of blockly.
They will only trigger if the variable is changed via the web interface of via json.
That is to prevent loops
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Blockly examples
Sorry but your information is not correct for dzVents.mosjonathan wrote: ↑Saturday 04 January 2020 8:33 That does not work.
Blockly and lua and dzVents wil not trigger in a variable that is changed via scripts of blockly.
This dzVents script changes the content of a variable and is triggered by that change.
Code: Select all
return {
on = {
variables = {
'my(integer)UserVariable'
}
},
execute = function(dz, item)
dz.log('Variable ' .. item.name .. ' is now: ' .. item.value)
item.set(item.value + 1).afterSec(10)
end
}
- Spoiler: show
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 40
- Joined: Friday 24 February 2017 21:20
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Blockly examples
Hi waaren i did not know that dzVents triggered on user variabels changed in scripts.
Is that changed somewhere along the line?
Now i can make Some scripts simpler
Thanks for the correction
Is that changed somewhere along the line?
Now i can make Some scripts simpler
Thanks for the correction
-
- Posts: 20
- Joined: Sunday 30 December 2018 19:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Oss NL
- Contact:
Re: Blockly examples
so not possible in Blockly, but possible in dzVents.
other option in Blockly is using virtual switches instead of user variables. (functional but not clean)
other option in Blockly is using virtual switches instead of user variables. (functional but not clean)
-
- Posts: 30
- Joined: Wednesday 09 January 2019 17:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Nederland
- Contact:
Re: Blockly examples
Hi there, need some help with Blockly.
I made a script that when Me and my wife (phones) leave the building all the switches must turn off.
That works fine, thanks to iDetect. But. Every evening my UniFi Switch "does not see" my phones for 2 or 3 seconds once or twice an evening and then it gets dark.
I tried to change the script so that there is a timer countdown 10 seconds and then check again if the phones are off but I don't know anymore how to make a timer which is counting off
Can someone help me please.
I made a script that when Me and my wife (phones) leave the building all the switches must turn off.
That works fine, thanks to iDetect. But. Every evening my UniFi Switch "does not see" my phones for 2 or 3 seconds once or twice an evening and then it gets dark.
I tried to change the script so that there is a timer countdown 10 seconds and then check again if the phones are off but I don't know anymore how to make a timer which is counting off
Can someone help me please.
-
- Posts: 170
- Joined: Monday 22 January 2018 21:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
I think you need to change some settings in your iDetect plugin. Make the grace period longer and/or more polls in the grace period. It will prevent false negatives...
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
Zwave, Zigate, RFlink etc.
-
- Posts: 30
- Joined: Wednesday 09 January 2019 17:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Nederland
- Contact:
Re: Blockly examples
Thank you Geitje
My grace/poll period is now 30/15; you mean to increase to 60/15 or even 60/30?
Who is online
Users browsing this forum: No registered users and 1 guest