Page 1 of 1
Use current state later in script
Posted: Saturday 29 October 2016 12:04
by NLcom
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?
Re: Use current state later in script
Posted: Wednesday 02 November 2016 8:36
by dannybloe
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.
Re: Use current state later in script
Posted: Wednesday 02 November 2016 9:06
by NLcom
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
Re: Use current state later in script
Posted: Tuesday 15 November 2016 8:57
by NLcom
Can anyone give me some pointers?