I have a virtual device called “airco stroom”
That shows amperage when airco is running
I want when airco stroom is above 0 another virtual device called airco goes on.
And when airco stroom is 0 virtual device airco goes off
How to do that?
Thanks
Edwin.
How to do this
Moderator: leecollings
-
- Posts: 630
- Joined: Saturday 21 September 2019 17:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.1
- Location: The Netherlands
- Contact:
Re: How to do this
Create a dzvents script with this content:
Note: naming of your devices has to match exactly with the code.
This assumes you use a ampere device and a switch device.
For more details have a look here
https://www.domoticz.com/wiki/DzVents:_ ... _scripting
Code: Select all
return {
on = {
devices = {
'airco stroom'
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'example',
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
if domoticz.devices('airco stroom').current>0 and domoticz.devices('airco').state=="Off"
then
domoticz.devices('airco').switchOn()
else
if domoticz.devices('airco stroom').current==0 and domoticz.devices('airco').state=="On"
then
domoticz.devices('airco').switchOff()
end
end
end
}
This assumes you use a ampere device and a switch device.
For more details have a look here
https://www.domoticz.com/wiki/DzVents:_ ... _scripting
-
- Posts: 252
- Joined: Sunday 09 October 2016 20:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: Nederland
- Contact:
Re: How to do this
Thank you ,
I’m gonna try it.
Regards
Edwin
I’m gonna try it.
Regards
Edwin
Who is online
Users browsing this forum: No registered users and 0 guests