Set value - core - lights always turn off

Hi All,

I’m trying to use CORE to dim my lights by a value store in a variable(ultimately I’ll have this variable changed at different times or the day). However, whatever this variable is set to it always causes the lights to turn off (hue).

What am I doing wrong?

Thanks !!

Have you tried changing the variable data type to number instead of decimal?

thanks for the reply, how do i change this? they type is grayed out…

Good question. I thought you had defined it yourself lol. Let me try it on my end.

Try reinitialize the variable again.

1 Like

Hi,

It seems the type is auto set by the value you specify …

I see what you mean. I had to add an extra task to convert the data type to number, then it worked for me (set the level). Not sure if @ady624 has time to visit this now that he’s working on the web version :slight_smile:

Ah! Would you mind telling me how you did this?

Thanks!!

I set the variable to the same value except changed the data type.

Using Dining Room Hue...
► Set color temperature to 2710°K
► Set number variable {auto_dim_to%} = auto_dim_to%
► Set level to auto_dim_to%%

Great I’ll try this !

Can I set this once at the beginning and the jump into the if light on then statements; I have a lot of these to check if each individual light is on before applying the colour and level change…

Also, is there a way to reorder existing actions ?

Thanks for your help !

I think so, if the variable is all local to the tasks, I don’t see why it shouldn’t work.

It’s currently a global variable as I was planning to have something else run to alter the level at different times of the day. Any implications for using a global variable in this context ?

Thanks !

Not really, it should be good.

That all works ! Thanks for your help !!

1 Like