Closed cgrin closed 4 hours ago
hey @cgrin , check this thread https://github.com/cgiesche/streamdeck-homeassistant/discussions/275#discussioncomment-9506850
@artistro08 Fantastic! I had a feeling there was a way to make it work... wasn't far off 😅
Thanks for the heads up!
I've set up an encoder to control room lights via Home Assistant. Short Press toggles the lights. Rotation I've set to turn on with service data of
{"brightness_pct":{{ rotationPercent}}}
. With a tick multiplier of 10, rotation generally acts as expected, but I'm seeing some weird edge cases.If I turn on the lights with a press, they turn on to 100% as expected, but a single tick of CCW rotation turns the lights fully off.
Additionally, if the brightness is changed externally, the display reflects the change immediately but doesn't seem to update the state of the brightness used to adjust e.g. if the lights are at 50% brightness and that's increased to 100% by HA/Homekit/Physical switch, a subsequent rotation changes the state from 50% not 100%.
I tried using the
{{ticks}}
variable in conjunction with the state of brightness from a jinja template ,thinking that'd be more reliable, but can't seem to make that work either. I tried both payloads below{ "brightness_pct":"{% raw %}{{ state_attr('light.office_main_lights','brightness')}} + {{ticks}}{% endraw %}" }
{ "brightness_pct":"{% raw %}{{ state_attr('light.office_main_lights','brightness')}} {% endraw %}"+ {{ticks}} }