smhex / homebridge-wled-ws

Homebridge Plugin for LED strips controlled by WLED
Apache License 2.0
7 stars 1 forks source link

Presets not updating....kinda.... #121

Open ShaunRoberts543 opened 1 month ago

ShaunRoberts543 commented 1 month ago

Describe The Bug: If you are in Homekit and select a preset, that preset turns on, all is good. Then if you select a different preset, the 2nd preset turns on as it should, but it does not shut off the first preset. If I quit Homekit and open back up, it will update to correct status. If I change something on web interface like brightness it will update that immediately in Homekit, but still shows both presets "on". At that point it should shut both off since there was a deviation from the preset brightness setting.

To Reproduce: Turn on Homekit switch for one preset, then turn on another.

Expected behavior: The first preset should turn off when the 2nd is selected.

Logs:

[15/07/2024, 17:54:51] [wled-ws platform] Set On state for preset 1 (GOOD AFTERNOON) of controller Office Door Matrix to: On [15/07/2024, 17:54:51] [wled-ws platform] Received controller Office Door Matrix state update [15/07/2024, 17:54:51] [wled-ws platform] Controller Office Door Matrix updated current brightness to: 50 [15/07/2024, 17:54:51] [wled-ws platform] Controller Office Door Matrix updated current preset to: 1 [15/07/2024, 17:54:51] [wled-ws platform] Set On state for new preset 1 (GOOD AFTERNOON) of controller Office Door Matrix to: On [15/07/2024, 17:54:51] [wled-ws platform] Received info for controller Office Door Matrix [15/07/2024, 17:54:55] [wled-ws platform] Set On state for preset 2 (On Phone) of controller Office Door Matrix to: On [15/07/2024, 17:54:55] [wled-ws platform] Received controller Office Door Matrix state update [15/07/2024, 17:54:55] [wled-ws platform] Controller Office Door Matrix updated current preset to: 2 [15/07/2024, 17:54:55] [wled-ws platform] Set On state for last active preset 1 (GOOD AFTERNOON) of controller Office Door Matrix to: Off [15/07/2024, 17:54:55] [wled-ws platform] Set On state for new preset 2 (On Phone) of controller Office Door Matrix to: On [15/07/2024, 17:54:55] [wled-ws platform] Received info for controller Office Door Matrix

Plugin Config:

{ "name": "Office Door Matrix", "address": "192.168.7.252", "presets": "On Phone,GOOD AFTERNOON,Distortion Waves", "showRealTimeModeButton": false, "resetRealTimeModeAfterStream": true },

Screenshots:

Screenshot 2024-07-15 at 5 53 12 PM

Environment:

smhex commented 1 month ago

Hi @ShaunRoberts543 , thanks for reporting your issue. I will try to reproduce it using your configuration. The given log output shows the expected behavior at least (preset 1 is set to OFF after switching preset 2 to ON). Which WLED firmware do you use?

ShaunRoberts543 commented 1 month ago

I am on 14.4 with that node.

Shaun Roberts @.*** 419.450.7116 mobile Linkedin.com/in/smr543

On Jul 16, 2024, at 11:05 AM, smhex @.***> wrote:

Hi @ShaunRoberts543 https://github.com/ShaunRoberts543 , thanks for reporting your issue. I will try to reproduce it using your configuration. The given log output shows the expected behavior at least (preset 1 is set to OFF after switching preset 2 to ON). Which WLED firmware do you use?

— Reply to this email directly, view it on GitHub https://github.com/smhex/homebridge-wled-ws/issues/121#issuecomment-2231150760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUIKMBPSPCW4ZF7IVWJ7CF3ZMUZDRAVCNFSM6AAAAABK5LYBBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGE2TANZWGA. You are receiving this because you were mentioned.

smhex commented 1 month ago

Weird...I was not able to reproduce it with your presets on my iPhone, but on my Macbook. Both devices get out of sync in HomeKit. Normally this should not happen. My HomeKit controller is an AppleTV...

Which Apple device do you use, iPad?

smhex commented 1 month ago

Hi @ShaunRoberts543 , after removing the spaces from your preset names it works as expected. Adding them again does not bring back the original behavior. Still weird. Can you provide a debug log? Thanks!

ShaunRoberts543 commented 1 month ago

Removing the spaces worked for me as well. Only time I has issue was after a bridge restart and it seemed to get stuck, but normal operation it appears to update accordingly. Here is some full log of the preset changes:

[16/07/2024, 13:07:57] [wled-ws platform] Set On state for preset 1 (GOODAFTERNOON) of controller Office Door Matrix to: On [16/07/2024, 13:07:57] [wled-ws platform] Received controller Office Door Matrix state update {"on":true,"brightness":128,"transition":7,"presetId":1,"playlistId":-1,"AudioReactive":{"on":false},"nightlight":{"on":false,"duration":60,"mode":1,"targetBrightness":0,"remaining":-1},"udpSync":{"send":false,"receive":true,"sgrp":0,"rgrp":0},"liveDataOverride":0,"mainSegmentId":0,"segments":[{"id":0,"start":0,"stop":32,"startY":0,"stopY":8,"length":32,"grouping":1,"spacing":0,"offset":0,"on":true,"freeze":false,"brightness":255,"cct":127,"set":0,"name":"GOOD AFTERNOON!","colors":[[255,0,0],[0,0,0],[0,0,0]],"effectId":122,"effectSpeed":230,"effectIntensity":128,"paletteId":0,"c1":0,"c2":204,"c3":16,"selected":true,"reverse":false,"mirror":false,"rY":false,"mY":false,"tp":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":0}]} [16/07/2024, 13:07:57] [wled-ws platform] Controller Office Door Matrix updated current brightness to: 50 [16/07/2024, 13:07:57] [wled-ws platform] Controller Office Door Matrix updated current preset to: 1 [16/07/2024, 13:07:57] [wled-ws platform] Set On state for last active preset 3 (DistortionWaves) of controller Office Door Matrix to: Off [16/07/2024, 13:07:57] [wled-ws platform] Set On state for new preset 1 (GOODAFTERNOON) of controller Office Door Matrix to: On [16/07/2024, 13:07:57] [wled-ws platform] Received info for controller Office Door Matrix [16/07/2024, 13:08:03] [wled-ws platform] Set On state for preset 2 (OnPhone) of controller Office Door Matrix to: On [16/07/2024, 13:08:03] [wled-ws platform] Received controller Office Door Matrix state update {"on":true,"brightness":128,"transition":7,"presetId":2,"playlistId":-1,"AudioReactive":{"on":false},"nightlight":{"on":false,"duration":60,"mode":1,"targetBrightness":0,"remaining":-1},"udpSync":{"send":false,"receive":true,"sgrp":0,"rgrp":0},"liveDataOverride":0,"mainSegmentId":0,"segments":[{"id":0,"start":0,"stop":32,"startY":0,"stopY":8,"length":32,"grouping":1,"spacing":0,"offset":0,"on":true,"freeze":false,"brightness":255,"cct":127,"set":0,"name":"ON THE PHONE.....","colors":[[255,0,0],[0,0,0],[0,0,0]],"effectId":122,"effectSpeed":230,"effectIntensity":128,"paletteId":0,"c1":0,"c2":204,"c3":16,"selected":true,"reverse":false,"mirror":false,"rY":false,"mY":false,"tp":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":0}]} [16/07/2024, 13:08:03] [wled-ws platform] Controller Office Door Matrix updated current preset to: 2 [16/07/2024, 13:08:03] [wled-ws platform] Set On state for last active preset 1 (GOODAFTERNOON) of controller Office Door Matrix to: Off [16/07/2024, 13:08:03] [wled-ws platform] Set On state for new preset 2 (OnPhone) of controller Office Door Matrix to: On [16/07/2024, 13:08:03] [wled-ws platform] Received info for controller Office Door Matrix

Any other information that could help please let me know!

Thank you, Shaun

On Jul 16, 2024, at 12:14 PM, smhex @.***> wrote:

Hi @ShaunRoberts543 https://github.com/ShaunRoberts543 , after removing the spaces from your preset names it works as expected. Adding them again does not bring back the original behavior. Still weird. Can you provide a debug log? Thanks!

— Reply to this email directly, view it on GitHub https://github.com/smhex/homebridge-wled-ws/issues/121#issuecomment-2231326845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUIKMBOE3RQVWV7Y2YBV4RLZMVBFZAVCNFSM6AAAAABK5LYBBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGMZDMOBUGU. You are receiving this because you were mentioned.

ShaunRoberts543 commented 1 month ago

Oh and it is working correctly after removing spaces on my Mac and iPad, tried them both.

Thanks, Shaun

On Jul 16, 2024, at 12:14 PM, smhex @.***> wrote:

Hi @ShaunRoberts543 https://github.com/ShaunRoberts543 , after removing the spaces from your preset names it works as expected. Adding them again does not bring back the original behavior. Still weird. Can you provide a debug log? Thanks!

— Reply to this email directly, view it on GitHub https://github.com/smhex/homebridge-wled-ws/issues/121#issuecomment-2231326845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUIKMBOE3RQVWV7Y2YBV4RLZMVBFZAVCNFSM6AAAAABK5LYBBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGMZDMOBUGU. You are receiving this because you were mentioned.

smhex commented 1 month ago

Hi @ShaunRoberts543 ,

thank you very much. I have still no idea why there is a different behavior on Mac and iPhone. The plugin does not differentiate between preset names with or without spaces. However, I have seen, that HomeKit does not request a state update when the error occurs. It can be triggered manually when switching to another room and back in HomeKit. In that case the state is updated afterwards even if it seems to be frozen before. Maybe there is something in between, which I cannot see by now. I will keep this issue in mind, maybe there is an inspiration coming along the way 😃. Until the root cause is identified, I recommend to use preset names without spaces as a workaround. I hope that works for you!