Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room lights brightness is never updated on brightness changes #152

Open
SweVictor opened this issue Jan 24, 2021 · 0 comments
Open

Room lights brightness is never updated on brightness changes #152

SweVictor opened this issue Jan 24, 2021 · 0 comments

Comments

@SweVictor
Copy link
Collaborator

Currently, brightness for room devices (config includeRoomsAsLights = true) is never updated on brightness changes (only when setting the value from HA).

This in itself will mean transitions for room devices will work a bit unexpectedly (room might have a brightness of 50, but all lights have actually been changed to 250 giving transition => 0 start from 50).

An even worse (and quite common example if not using the room sliders) is that a "good night transition" (Tun off ALL lights, transition over 60 seconds) will behave very oddly:

  • Room light = undefined (never set from HA since restart)
  • All actual lights in room = 255 (fully on)
  • HA command: TurnOff "all", transition = 60
  • hassio-plejd will get individual commands for all lights AND all rooms
  • Room = undefined => room will be turned off directly (so fully on => fully off for all lights)
  • Each light in the room will still be in the transition cycle so after turning off fully it will turn on with brightness 254, 253, 252, 251, ...

Really happy that I finally found out what was going on, but a bit hard to actually solve the problem from the hassio-plejd side. As a user you can

  • Transition rooms (will be more efficient, but currently has the problem of room brightness is often wrong)
  • Only transition lights, not room, or set includeRoomsAsLights = false to avoid the problem

Mqtt is quite quick, so all transition commands are sent in ~1 second. We could wait 1s and then try in some way to aggregate transition commands before starting the transition, but I don't really like artificial delays unless absolutely necessary.

Either way I think we should calculate room brightness on each update (the Plejd app actually seems to set room brightness = MAX(all lights in room), which seems a bit strange to me, but is probably a good choice all in all). Transitions on rooms with devices having different brightness will still be a bit strange, but at least better.

Ideas?

Repository owner deleted a comment from Nicklas86 Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant