Hi, i have an on/off switch that is set by measuring the usage of a washingmachine.
When it is finished my on/off switch is triggered to on and a wav file is played..
So far so good...
I also made a script for the on/of switch so that is will be turned off after 10 seconds...
This doed not work, and i dont know why... seems so easy...
-- switch
return {
on = {devices = {'voice_vorstalarm'}},
logging = { level = domoticz.LOG_DEBUG ,
marker = "Security"},
execute = function(dz, device, info)
if device.state == 'On' then
device.switchOff().afterSec(10)
end
end
}
switch off after
Moderator: leecollings
-
pvklink
- Posts: 822
- Joined: Wednesday 12 November 2014 15:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest b
- Contact:
switch off after
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Jablotron connection, Ikea
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: switch off after
What this script does is switch Off the voice_vorstalarm 10 seconds after it has been switched On. Is that what you intend ?pvklink wrote: Wednesday 13 February 2019 12:05 I also made a script for the on/of switch so that is will be turned off after 10 seconds...
This doed not work, and i dont know why... seems so easy...
If so please add a log statements to see what happens.
Code: Select all
-- switch
return {
on = {devices = {'voice_vorstalarm'}},
logging = { level = domoticz.LOG_DEBUG ,
marker = "Security"},
execute = function(dz, device, info)
dz.log("device " .. device.name .. " switched to " .. device.state,dz.LOG_DEBUG)
if device.state == 'On' then
device.switchOff().afterSec(10)
end
end
}
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
-
pvklink
- Posts: 822
- Joined: Wednesday 12 November 2014 15:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest b
- Contact:
Re: switch off after
Yes, when it becomes colder then x-degrees i get a voice message but the switch stays on..
So i want it off again after a period of time....
added the log now wait for a temperature change
So i want it off again after a period of time....
added the log now wait for a temperature change
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Jablotron connection, Ikea
-
pvklink
- Posts: 822
- Joined: Wednesday 12 November 2014 15:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest b
- Contact:
Re: switch off after
mmm.. strange it works now
problem was the refresh timer of my dashticz
problem was the refresh timer of my dashticz
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Jablotron connection, Ikea
-
pvklink
- Posts: 822
- Joined: Wednesday 12 November 2014 15:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest b
- Contact:
Re: switch off after
does work when i manually set the switch on but when my temperature script triggers this switch i get this
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: Constructed timed-command: Off
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: Constructed timed-command: Off AFTER 10 SECONDS
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: device voice_vorstalarm switched to On
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: Constructed timed-command: Off
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: Constructed timed-command: Off AFTER 10 SECONDS
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: device voice_vorstalarm switched to On
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Jablotron connection, Ikea
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: switch off after
Seems the standard messages to me. Maybe confusing but that is what you normally see when debug mode is on and you use the afterXXX() method .pvklink wrote: Wednesday 13 February 2019 13:47 does work when i manually set the switch on but when my temperature script triggers this switch i get this
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: Constructed timed-command: Off
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: Constructed timed-command: Off AFTER 10 SECONDS
2019-02-13 13:30:17.172 Status: dzVents: Debug: Security: device voice_vorstalarm switched to On
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
-
pvklink
- Posts: 822
- Joined: Wednesday 12 November 2014 15:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest b
- Contact:
Re: switch off after
mm.. it says device voice_vorstalarm switched to On ! instead of off
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Jablotron connection, Ikea
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: switch off after
Yes. That comes from this linepvklink wrote: Wednesday 13 February 2019 14:42 mm.. it says device voice_vorstalarm switched to On ! instead of off
Code: Select all
dz.log("device " .. device.name .. " switched to " .. device.state,dz.LOG_DEBUG)
Code: Select all
device.switchOff().afterSec(10)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