hassio-plejd icon indicating copy to clipboard operation
hassio-plejd copied to clipboard

Add experimental parsing for color temp support from Plejd API

Open SweVictor opened this issue 1 year ago • 10 comments

Plejd supports color temperature setting on top of dimming.

This PR is an experimental first step to try to implement support.

Expected functionality

  • Color temperature-capable devices show up as such in Home Assistant
  • It is possible to set color temp in the correctly supported range from HA
  • Nothing happens when setting color temp

Help needed

I don't personally own any color temperature capable Plejd devices, so I will need logs from the silly level minimally showing

  • Site JSON response (remove sensitive info)
  • Discovery phase
  • Setting values in HA with resulting MQTT messages and parsing of those
  • Logs uploaded as files to not spam chat too much

Remaining steps

  • Verify parsing of traits in PlejdApi.js
  • Verify that MQTT discovery to HA is correct and that devices are registered correctly
  • View and parse MQTT messages from HA setting state including color temperature
  • Implement new BLE commands to support color temperature

SweVictor avatar Nov 19 '23 11:11 SweVictor

Hi @SweVictor , did you get any logs?

I have DWN-01 now and dimming doesnt work. Would be super nice if we could fix that?

seagri avatar Jul 08 '24 08:07 seagri

Hej! @SweVictor

I would love to help you with this as I own some. But not sure how to get these.

  • Site JSON response (remove sensitive info)
  • Discovery phase
  • Setting values in HA with resulting MQTT messages and parsing of those

Could you guide me some more?

seagri avatar Aug 16 '24 07:08 seagri

I hope this is what you need. plejd.log

seagri avatar Aug 16 '24 07:08 seagri

I hope this is what you need. plejd.log

Seems like you found the log at least!

Just to double-check - are you running the code from the branch with the try to implement support? If you run the main release I don't think it's supposed to work.

https://github.com/icanos/hassio-plejd/tree/feature/experimental-color-temp

If yes, please clarify when you did what that didn't work (preferably with timestamps in the log). As in

At 2024-08-16 09:20:39 I clicked on and then off in HA Nothing/something/xyz happened to the light At 2024-08-16 09:21:41 I changed dim level to xyz YYZ happened to the light (or similar, basically trying to show what's working and not and if it's matching "expected functionality" in this PR)

SweVictor avatar Aug 16 '24 14:08 SweVictor

I hope this is what you need. plejd.log

Seems like you found the log at least!

Just to double-check - are you running the code from the branch with the try to implement support? If you run the main release I don't think it's supposed to work.

https://github.com/icanos/hassio-plejd/tree/feature/experimental-color-temp

If yes, please clarify when you did what that didn't work (preferably with timestamps in the log). As in

At 2024-08-16 09:20:39 I clicked on and then off in HA Nothing/something/xyz happened to the light At 2024-08-16 09:21:41 I changed dim level to xyz YYZ happened to the light (or similar, basically trying to show what's working and not and if it's matching "expected functionality" in this PR)

aaah, yeah I was running the main release.

I was fiddling with this today and managed to install hassio-plejd-feature-DWN-dimmable-fix and testing that out. Dimming seem to work for DWN-01 now which is good. I can install the hassio-plejd-feature-experimental-color-temp and test during the weekend.

seagri avatar Aug 16 '24 14:08 seagri

Turned ON Kökgång at 2024-08-22 09:42:14 DBG [plejd-ble] Kökgång and lights turned on

turned OFF at 2024-08-22 09:50:11 and it turned OFF

changed dim level to 100% for Köksö at 2024-08-22 09:52:07 and it dimmed

plejd_logs_color.txt

seagri avatar Aug 22 '24 07:08 seagri

tried to change color in HA tried_to_change_color.txt

seagri avatar Aug 22 '24 07:08 seagri

Thanks @seagri! So... Is it working as expected in the "expected functionality" section in the first post? If not, what's not working as you expect it to?

irisityvictorhagelback avatar Aug 22 '24 14:08 irisityvictorhagelback

The dimming works but not changing the color.

seagri avatar Aug 23 '24 07:08 seagri

Is the logs OK or should I do something else?

I trying to click 1 of the 4 color buttons in HA and getting this ` 2024-09-05 13:27:47 VRB [plejd-mqtt] Received mqtt message on homeassistant/light/plejd/D4DBAE3BA354_0/set

2024-09-05 13:27:47 VRB [plejd-mqtt] Getting device D4DBAE3BA354_0 from registry 2024-09-05 13:27:47 VRB [plejd-mqtt] Got mqtt SET command for light, Entré (D4DBAE3BA354_0): {"state":"ON","color_temp":454} 2024-09-05 13:27:47 INF [device-comm] Plejd got turn on command for Entré (D4DBAE3BA354_0), brightness undefined 2024-09-05 13:27:47 DBG [device-comm] Queueing turn on Entré (D4DBAE3BA354_0). No brightness specified, setting DIM to previous. 2024-09-05 13:27:48 DBG [device-comm] Write queue: Processing Entré (D4DBAE3BA354_0). Command Turn on. Total queue length: 0 2024-09-05 13:27:48 VRB [plejd-ble] Sending 6 byte(s) of data to Plejd. 130110009701 `

But nothing happens with the light.

image

seagri avatar Sep 05 '24 11:09 seagri