is Blockly a one shot operation ?

Moderator: leecollings

Post Reply
Dave21w
Posts: 369
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

is Blockly a one shot operation ?

Post by Dave21w »

What I mean by the title is if I create a block that says If the Lux level of a sensor is equal to or less than 90 then switch light A on and I then turn light A off manually will it turn it back on again or as it has already run once will that be it until the lux goes above 90 and then back below it again.

Thanks
Dave
User avatar
waltervl
Posts: 5389
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: is Blockly a one shot operation ?

Post by waltervl »

A Blockly script is triggered by a change. The type of change can be set.
See wiki page https://www.domoticz.com/wiki/Blockly#Triggers

So in your case if the trigger is device the lamp will always be switched on if the lux has a value greater than 90. If you switch the lamp off manually after a device change (could be any device) the script is triggered again and the lamp will be switched on.

But as I have no Blockly scripts running I am not 100% sure...
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Dave21w
Posts: 369
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: is Blockly a one shot operation ?

Post by Dave21w »

OK looks like I need to do some research, I want the lounge table lamp to come on when my Lux sensor says its below 90 but obviously I need to turn it off when I go to bed !
User avatar
madpatrick
Posts: 645
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: is Blockly a one shot operation ?

Post by madpatrick »

maybe this will help a bit
2022-08-24 10_04_53-Domoticz - Gebeurtenissen.png
2022-08-24 10_04_53-Domoticz - Gebeurtenissen.png (29.49 KiB) Viewed 1999 times
It is now a very simple script and you can please with the parameters.
For example with the LUX/TIME/etc...
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Dave21w
Posts: 369
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: is Blockly a one shot operation ?

Post by Dave21w »

Thanks for the suggestion, I have implemented something similar as you can see.
Lux Switch.jpg
Lux Switch.jpg (25.01 KiB) Viewed 1992 times
This allows me to turn the lamp off early as long as it's below 30 Lux outside without it then coming back on and stops it coming on early in the winter if it goes very cloudy during the day.
solarboy
Posts: 320
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: is Blockly a one shot operation ?

Post by solarboy »

madpatrick wrote: Wednesday 24 August 2022 10:07 maybe this will help a bit

2022-08-24 10_04_53-Domoticz - Gebeurtenissen.png

It is now a very simple script and you can please with the parameters.
For example with the LUX/TIME/etc...
Your "else if" has "<=" which is not correct, it can be "=" or "not ="
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests