OpenBK7231T_App icon indicating copy to clipboard operation
OpenBK7231T_App copied to clipboard

HA discovery wrong for two PWM lamp with Brightness & Color Temperature

Open openshwprojects opened this issue 3 years ago • 3 comments
trafficstars

According to this user: https://www.elektroda.com/rtvforum/viewtopic.php?p=20233683#20233683 the generated config looks wrong.

  1. It outputs devname/1/set/ and /1/get topics, while they should be hidden and are for internal use only
  2. it outputs led_dimmer command but no led_temperature command If I look at the code, it indeed seems like a problem: image The correct thing is to:
  • control dimmer by led_dimmer
  • control temperature by led_temperature
  • control state by led_enableAll 1 or 0
  • no direct set or get

openshwprojects avatar Oct 13 '22 04:10 openshwprojects

The current discovery for 1-2 PWMs is based on existing hass config generation.

I agree it makes sense to use led_enableAll, the function apply_smart_light seems to handle that. The direct set/get are only for relays.

  • Would led_enableAll handle just one PWM?
  • How do we know that temperature is supported with PWM? Is the assumption that 3 or 5 PWM would be using temperature not correct. Should any PWM have temperature handling?

And we probably just want to emit one entity instead of 2 separate entities for each PWM as done for RGB?

iprak avatar Oct 15 '22 11:10 iprak

@iprak led_enable handles one PWM well, I have single color LED strip on T and it works well with led_enableall

Temperature... well.... The assumption currently is: 2 PWMs = temperature supported (white cool and warm) 5 PWMs = temperature supported (white cool and warm and RGB)

openshwprojects avatar Oct 16 '22 12:10 openshwprojects

I have it all working, just doing a bit more testing. I will push it out after #292.

I discovered 2 problems. First was that led_enableAll usng 1/0 and so the on/off payload needs to use 1/0. Second, the on_cmd_type=brightness does not work with OBK. As per https://www.home-assistant.io/integrations/light.mqtt/, homeassistant only works with brightness value in that case and OBK does not handle toggling light well in that case. Using first works well,

iprak avatar Oct 16 '22 23:10 iprak

This was addressed in #300, please check.

iprak avatar Oct 20 '22 09:10 iprak

I think it's solved. Closing,

openshwprojects avatar Feb 22 '23 12:02 openshwprojects