Hi.
I have just started looking a moving my lua and blockly to dzvents.
I was just wondering something about the triggers.
If I have
On
Timer : every 1 minute
Switch : my-switch
Will this run the script every min, AND when the switch is switched?
I am hoping to only run the script WHEN the switch is on.
So something like
On: timer: every minute ( when switch ==on).
Is it possible to do it in the top trigger section?
I know it will be possible to run the script every min, and then inside the execute section have:
If switch=on then
Do stuff....
End.
But I am trying not to have too many scripts running every minute.
Thanks.
Run script every min, but only when a switch is on.
Moderator: leecollings
-
- Posts: 113
- Joined: Friday 08 January 2016 12:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Run script every min, but only when a switch is on.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
-
- Posts: 44
- Joined: Wednesday 13 June 2018 12:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Run script every min, but only when a switch is on.
Not sure dzvents does what you’re looking for, but my proposed extension would help. You could have a script that only is triggered by the switch, but then fires off a 1 minute timer to re-trigger itself.
viewtopic.php?f=59&t=24022&p=185214#p185214
viewtopic.php?f=59&t=24022&p=185214#p185214
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Run script every min, but only when a switch is on.
It doesn't matter if you add some functionality to the on-section because domoticz only has a timer trigger that triggers every minute. So that's what dzVents gotta work with. All the checking for state of devices is done on the Lua side (in dzVents).
Having said that... just make an every-minute timer and check inside your execute function. If you don't want to do that, create a timer function and check in there (see the doc about this). But basically it's all the same.
Having said that... just make an every-minute timer and check inside your execute function. If you don't want to do that, create a timer function and check in there (see the doc about this). But basically it's all the same.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 113
- Joined: Friday 08 January 2016 12:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Run script every min, but only when a switch is on.
Thanks for the clarification.
I think I’ll set a timer for every min, and then check to see if the switch is on inside the execute.
How many scripts can you have Running every min before it would start to have an impact on a rasp pi?
I’m probably worrying about nothing.
I think I’ll set a timer for every min, and then check to see if the switch is on inside the execute.
How many scripts can you have Running every min before it would start to have an impact on a rasp pi?
I’m probably worrying about nothing.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.
Next: harmony hub.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Run script every min, but only when a switch is on.
I have > 20 and no significant impact.sion wrote: ↑Sunday 05 August 2018 20:10 Thanks for the clarification.
I think I’ll set a timer for every min, and then check to see if the switch is on inside the execute.
How many scripts can you have Running every min before it would start to have an impact on a rasp pi?
I’m probably worrying about nothing.
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
Who is online
Users browsing this forum: No registered users and 1 guest