I'm looking for a way to dim my Hue lights when a certain user variable has value 1. After the value has gone back to value 0 I want to switch the lights back to their original state.
How can I do this with this framework?
Use current state later in script
Moderator: leecollings
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Use current state later in script
You could create a persistent-storage variable that you set when you set the variable to 1. When the variable is 0 again you read that variable. Quite simple actually.
Let me know if you need more help.
Let me know if you need more help.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 3
- Joined: Saturday 29 October 2016 11:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Use current state later in script
Thanks, Danny.
I was looking at that item in the wiki but don't quite understand how to put the current Hue state of a group of lights in a variable. The user variable that I want to check before dimming the lights is controlled in a different script.
So basically this would be my logic:
- Check user variable = 1
- Save current Hue svalue
- Dim lights
- Check user variable = 0
- Set Hue group to previous svalue
I was looking at that item in the wiki but don't quite understand how to put the current Hue state of a group of lights in a variable. The user variable that I want to check before dimming the lights is controlled in a different script.
So basically this would be my logic:
- Check user variable = 1
- Save current Hue svalue
- Dim lights
- Check user variable = 0
- Set Hue group to previous svalue
-
- Posts: 3
- Joined: Saturday 29 October 2016 11:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Use current state later in script
Can anyone give me some pointers?
Who is online
Users browsing this forum: No registered users and 1 guest