Hi,
I've created a user variable VH1, type time, value 05:00.
How can I assign a new value (e.g. 06:00) to this variable in a script?
I've tried:
- dz.variables('VH1').value='06:00'
- dz.variables('VH1').time.hour=6
- dz.variables('VH1') .time='06:00'
- dz.variables('VH1')=dz.variables('VH1').addHours(1)
No error, but no change!
Some idea to solve this problem?
Thanks in advance,
Time user variable [Solved]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Time user variable [Solved]
as described in the wiki page on this. To set a variable to a value use the method set.
So here you would use
Code: Select all
dz.variables('VH1').set('06:00')
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: 9
- Joined: Sunday 11 November 2018 12:25
- Target OS: Linux
- Domoticz version: 12896
- Location: Ferrières (BE)
- Contact:
Re: Time user variable
Thanks for this fast answer.
I had tried dz.variables('VH1').time.set('06:00') which causes an error.
I had tried dz.variables('VH1').time.set('06:00') which causes an error.
Who is online
Users browsing this forum: renerene and 0 guests