Lights go red on contact change

been having a good look this morning and it looks like the hue bridge isn't updating HE quick enough. I can turn a light off and it still reports it as on. This is where the odd behaviour is coming from. In your HE when you turn a light off does it report instantly in HE on the device page?

Why are you still controling the lights in the hue app?

1 Like

@BorrisTheCat I'm not and never have done. The lights are controlled by HE only. The hue app is never touched

I ended up tweaking this rule one more time. I added a custom action to refresh the bulb at the beginning, and a half second delay to the set variable lines and a one second delay to the turn red command. I found that the bulb was changing states faster than the states updated in HE.

I've now got this

IF (Bi Fold Door open(F) [FALSE]) THEN
Refresh: Hue Bridge (039E97)
Delay 0:00:00.5
Capture: Office lamp
Delay 0:00:00.5
Set color: Office lamp ->Level: 50
Delay 0:00:00.5
Set color: Office lamp ->Custom color ->Hue: 1 ->Sat:
ELSE
Delay 0:00:00.5
Restore: Office lamp
Refresh: Hue Bridge (039E97)
END-IF

if the light is on and is white - red light on, red light off and back to white - works

If the light is off - red light on then red light off - however when the light is turned on again the red light is there and not the used colour from before. Not working so well.

So frustrating as its nearly there!

1 Like

I structured mine this way :

Select Actions for Alert : Open - Back Door
refresh() on Spots : Media Room 4
IF (Contact - Back Door open(F) [FALSE]) THEN
Set ct to Spots : Media Room 4 colorTemperature --> delayed: 0:00:00.5
Set lvl to Spots : Media Room 4 level --> delayed: 0:00:00.5
Set color: Spots : Media Room 4 ->Custom color ->Hue: 1 ->Sat: 100 ->Level: 50 --> delayed: 0:00:01
ELSE
Color Temperature: Spots : Media Room 4: ct(5617): lvl(70)
END-IF

even adding the refresh hub before the if statement still has the light go red when its turned back on and not the previous colour it was

It sounds like the capture is happening after the light change. I'd try removing the delay on your capture or extend the light change to red by another half second.

When the bulbs off and then turned on it still goes red after the trigger has been done and not back to the colour it should do.

Refresh: Hue Bridge (039E97)
IF (Bi Fold Door open(F) [FALSE]) THEN
Refresh: Hue Bridge (039E97)
Delay 0:00:00.5
Capture: Office lamp
Delay 0:00:02
Set color: Office lamp ->Level: 50
Delay 0:00:02
Set color: Office lamp ->Custom color ->Hue: 1 ->Sat:
ELSE
Delay 0:00:00.5
Restore: Office lamp
Refresh: Hue Bridge (039E97)
END-IF

Your capture and color change to red are still happening on the same delay. Some commands take longer to execute than others. You may issue them in a 1.2.3 order but if the first command takes longer to execute than the second one they could be going in a 2.1.3 order. Having the capture and color change timed like that the color change could be registering before the capture.

Refresh the hub, capture on .5s delay, change to red on 1s delay.

If that isn't working than you have network anomalies that are causing things to execute in the wrong order. Time to turn on logging in your rule and trip things while watching the logs until you figure out why this is happening.

Then refresh is NOT your issue as when changes are made in HE the state is changed.

Perfect this proves what I have been telling you. It's not your rule and most of them delays are not needed only the one between the on and the colour change.

What brand of lamp are they and what country are you in?

BTW you can prove all of this by just using the device page. Set it to white turn off the lamp set the colour to red light will turn on but not to red. Now set it to red again and turn it off, now set a Kelvin. Light will turn on but will be red. Now set Kelvin again and it will go to correct Kelvin.

1 Like

When I set the colour temp it responds and works :slight_smile: however when i click in the colour map and then click set colour the bulb doesnt change. Heres the problem! The bulb is a hue gen 2 for info.

ah i though it was like webcore and worked down the list, this makes sense now

I was able to get a Hue bulb on a Hue hub to do everything without the delays or refresh. All of my delay/refresh/local variable -FU has been to make an OSRAM bulb work. Someone on here keeps bringing up the KISS principle. I don't know what a 70/80 heavy metal band has to do with home automation but I found that keeping things simple is best.

1 Like

It does when you have delays like how you are using them ie they are under the action. There is also delay per action, these delay just THAT action and the rest continues down the list.

As you should, the only time you need a delay like this is to allow the lamp to turn on before you change the colour mode, but only on the lamps that need it. Or you have the driver handle the commands better for that type of device then you don't need it at all.

@BorrisTheCat makes sense!

Ok, so it seems that the hue hub isnt updating HE and this is where the problem is. I'll contact support and see what workarounds they may have.

1 Like

If you're only making changes from within Hubitat, they should be reflected immediately. It's my understanding that this is what you are doing. A refresh from Hue should not be necessary. Have you verified that everything on the Current States on the device page updates as expected when you manually change something from that page?

if im on the bulbs stat page the colour box doesnt update when the rule run. However it does update if i manually do it on the page

do a basic rule and show us with screenshots so we can can also do the same to see if its just your setup.

do a rule with just set colour to red or something, then save it and open it again. You can then use the run actions to trigger it. Then set the lamp to a kelvin and run the rule and see if it still doesn't change.

So i did a simple lighting rule to turn the light on and off via the contact sensor and it worked well