Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
15.04k stars 3.25k forks source link

(HA related) Wled stays connected (Live) when hyperhdr connection is off #4299

Closed Nicko33127 closed 14 hours ago

Nicko33127 commented 16 hours ago

What happened?

I am not sure if there is an issue or it's more likely a User error made on my end.

I run Hyperhdr on my windows 10 pc and this pc also run my home assistant on a virtual machine. On hyperhdr I have 4 instances: -Cabinet for the light strip under the TV -Guitar for the light strip above my guitars on the left of the TV -Sofa for the strip behind the sofa -Books for the light strips on the right side of the TV

Tv is an Philips lamplights so no need for leds here. All 4 light strips are with wled, on esp8266 and esp32.

I made a helper in HA to turn off all 4 hyperhdr lights. The issue I a having is that the light do turn off and not longer match the TV content, but two of them are not manageable via wled as there are still linked to hyperhdr.

If HA hyperhdr helper is on I can see all wled are live:

Screenshot 2024-11-21 194753

If now I turn off all led switches via the helper, all the lights no longer macth the tv content but two of them stay connected:

Screenshot 2024-11-21 194811

When I go into the page I see this:

Screenshot 2024-11-21 194840

I made sure that all settings are the same on both wled and hyperhdr settings, but cannot figure how to have this setup.

To Reproduce Bug

Connect 4 instances with hyperhdr, and HA, turn the leds off

Expected Behavior

All wled become accessible agaim, and not only two of them

Install Method

Binary from WLED.me

What version of WLED?

0.14.4

Which microcontroller/board are you seeing the problem on?

ESP8266, ESP32

Relevant log/trace output

2024-11-21T20:04:14.177Z [LEDDEVICE] (ProviderRestApi.cpp:174) PUT begin: [http://192.168.68.131:80/json/state] [{"bri":128,"live":false,"lor":0,"mainseg":0,"nl":{"dur":60,"mode":1,"on":false,"rem":-1,"tbri":0},"on":true,"pl":-1,"ps":-1,"seg":[{"bri":255,"c1":128,"c2":128,"c3":16,"cct":127,"col":[[250,255,201,0],[0,0,0,0],[0,0,0,0]],"frz":false,"fx":0,"grp":1,"id":0,"ix":128,"len":199,"m12":0,"mi":false,"o1":false,"o2":false,"o3":false,"of":0,"on":true,"pal":0,"rev":false,"sel":true,"set":0,"si":0,"spc":0,"start":0,"stop":199,"sx":128}],"transition":7,"udpn":{"recv":true,"rgrp":128,"send":false,"sgrp":128}}]
2024-11-21T20:04:14.180Z [SMOOTHING0] Using alternative smoothing input (0)
2024-11-21T20:04:14.180Z [SMOOTHING3] Using alternative smoothing input (0)
2024-11-21T20:04:14.181Z [SMOOTHING2] Using alternative smoothing input (0)
2024-11-21T20:04:14.182Z [SMOOTHING1] Using alternative smoothing input (0)
2024-11-21T20:04:14.223Z [LEDDEVICE] (ProviderRestApi.cpp:198) PUT end (49 ms): [http://192.168.68.143:80/json/state] [{"bri":255,"live":false,"lor":0,"mainseg":0,"nl":{"dur":60,"mode":1,"on":false,"rem":-1,"tbri":0},"on":true,"pl":-1,"ps":-1,"seg":[{"bri":255,"c1":128,"c2":128,"c3":16,"cct":127,"col":[[255,255,255,0],[0,0,0,0],[0,0,0,0]],"frz":false,"fx":0,"grp":1,"id":0,"ix":128,"len":64,"m12":0,"mi":false,"o1":false,"o2":false,"o3":false,"of":0,"on":true,"pal":0,"rev":false,"sel":true,"set":0,"si":0,"spc":0,"start":0,"stop":64,"sx":128}],"transition":7,"udpn":{"recv":true,"rgrp":128,"send":false,"sgrp":128}}]
2024-11-21T20:04:14.223Z [LEDDEVICE] (ProviderRestApi.cpp:203) Reply OK [200]
2024-11-21T20:04:14.223Z [COMPONENTCTRL3] LED device: disabled
2024-11-21T20:04:14.226Z [LEDDEVICE] (ProviderRestApi.cpp:198) PUT end (51 ms): [http://192.168.68.136:80/json/state] [{"bri":255,"live":false,"lor":0,"mainseg":0,"nl":{"dur":60,"mode":1,"on":false,"rem":-1,"tbri":0},"on":true,"pl":-1,"ps":-1,"seg":[{"bri":255,"c1":128,"c2":128,"c3":16,"cct":127,"col":[[166,166,158,0],[0,0,0,0],[0,0,0,0]],"frz":false,"fx":0,"grp":1,"id":0,"ix":128,"len":500,"m12":0,"mi":false,"o1":false,"o2":false,"o3":false,"of":0,"on":true,"pal":0,"rev":false,"sel":true,"set":0,"si":0,"spc":0,"start":0,"stop":500,"sx":128}],"transition":7,"udpn":{"recv":true,"rgrp":128,"send":false,"sgrp":128}}]
2024-11-21T20:04:14.226Z [LEDDEVICE] (ProviderRestApi.cpp:203) Reply OK [200]
2024-11-21T20:04:14.227Z [COMPONENTCTRL2] LED device: disabled
2024-11-21T20:04:14.237Z [LEDDEVICE] (ProviderRestApi.cpp:198) PUT end (61 ms): [http://192.168.68.144:80/json/state] [{"bri":128,"live":false,"lor":0,"mainseg":0,"nl":{"dur":60,"mode":1,"on":false,"rem":-1,"tbri":0},"on":true,"pl":-1,"ps":-1,"seg":[{"bri":255,"c1":128,"c2":128,"c3":16,"cct":127,"col":[[255,245,253,0],[0,0,0,0],[0,0,0,0]],"frz":false,"fx":0,"grp":1,"id":0,"ix":128,"len":74,"m12":0,"mi":false,"o1":false,"o2":false,"o3":false,"of":0,"on":true,"pal":0,"rev":false,"sel":true,"set":0,"si":0,"spc":0,"start":0,"stop":74,"sx":128}],"transition":7,"udpn":{"recv":true,"rgrp":128,"send":false,"sgrp":128}}]
2024-11-21T20:04:14.237Z [LEDDEVICE] (ProviderRestApi.cpp:203) Reply OK [200]
2024-11-21T20:04:14.237Z [COMPONENTCTRL0] LED device: disabled
2024-11-21T20:04:14.330Z [LEDDEVICE] (ProviderRestApi.cpp:198) PUT end (152 ms): [http://192.168.68.131:80/json/state] [{"bri":128,"live":false,"lor":0,"mainseg":0,"nl":{"dur":60,"mode":1,"on":false,"rem":-1,"tbri":0},"on":true,"pl":-1,"ps":-1,"seg":[{"bri":255,"c1":128,"c2":128,"c3":16,"cct":127,"col":[[250,255,201,0],[0,0,0,0],[0,0,0,0]],"frz":false,"fx":0,"grp":1,"id":0,"ix":128,"len":199,"m12":0,"mi":false,"o1":false,"o2":false,"o3":false,"of":0,"on":true,"pal":0,"rev":false,"sel":true,"set":0,"si":0,"spc":0,"start":0,"stop":199,"sx":128}],"transition":7,"udpn":{"recv":true,"rgrp":128,"send":false,"sgrp":128}}]
2024-11-21T20:04:14.330Z [LEDDEVICE] (ProviderRestApi.cpp:203) Reply OK [200]
2024-11-21T20:04:14.330Z [COMPONENTCTRL1] LED device: disabled

Anything else?

No response

Code of Conduct

blazoncek commented 15 hours ago

Not a bug. When Hyperion disconnects it should send "end live" packet. If the disconnection is unexpected or Hyperion does not send such packet WLED will remain in live mode indefinitely.

dosipod commented 14 hours ago

@Nicko33127 I was testing on latest HyperHDR and 15.0-b7 and there is a setting for restore lights original state and once checked wled will came back to the effect it was playing prior to the stream so seems working as expected and this is the same behavior with Hyperion image

blazoncek commented 14 hours ago

@softhack007 it is not a bug. Hyperion (& co) sends "live":true which will switch WLED into indefinite live mode. You need to send "live":false to end live mode.

softhack007 commented 14 hours ago

@blazoncek thanks - yes I remember now we already had discussions about "forever means forever" regarding external overrides.

Nicko33127 commented 14 hours ago

Thank you for the quick answer. What still trouble le is that two of my wled turn off the live and switch back to wled control, and two don't.

Hyperhdr must send a false command to at least two of them?! This is the part that I don't understand. If nothing worked then yes the command don't reach. But it reaches half of them

I am not pretending to say that you guys are wrong, I just dont fully understand why it half doesn't work

blazoncek commented 14 hours ago

Yes. Unfortunately if Hyperion crashes user needs some tool to send "end live mode" or use override from UI.

blazoncek commented 14 hours ago

Some applications do not send "live":true and in such case WLED temporarily switches to live mode. If there is no input for about 2.5s then it will disengage live mode automatically.

Nicko33127 commented 14 hours ago

So Hyperion might be sending some live off signal, but only two wled pick the message?

And it bugs out by the time it sends the 3rd and 4th message?

Nicko33127 commented 14 hours ago

I also posted a query to the GitHub page of thehyperhdr HA add-on with the log in my initial post and he commented this : " As you can see we sent "live": false parameter and the command was received by all 4 WLED devices. Based on this, I assume that the problem is on the WLED side. Whats the type of these two unresponsive device: esp8266 or some esp32 variant?"

Not sure if this will help

Nicko33127 commented 14 hours ago

Some applications do not send "live":true and in such case WLED temporarily switches to live mode. If there is no input for about 2.5s then it will disengage live mode automatically.

See my answers above, seems like the live off Lewis send and traces are on hypereion log.

@blazoncek it might not make a difference but I must add that when I switch things off in HA/hyperhdr.. the light do switch off.. all 4 of them as expected. But I can only control via wled two of them. Of all lights switch off( the 4 different esp devices, don't this lean that they received the message?

Sorry I'm not trying to prove you wrong, i'm just trying to understand my issue, thank you agyfir the time you already took to answer

blazoncek commented 6 hours ago

Instead of quoting reply it is much better to link particular issue so we can join the discussion if necessary.

Regarding "some devices exit live, some don't": As "some" do and "some" don't it is going to be not so easy to determine where the underlying issue lies. I would suspect the following:

I've tackled similar issues in the past and was never able to reproduce but I have to admit that I use neither HA nor Hyperion.

You can check if sending "live":false restores WLED functionality by sending POST JSON request to http://wled-ip/json/. You can find examples on how to do that using curl online. You can also use other, more friendly, tools.