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

Add experimental parsing for color temp support from Plejd API #298

Open
wants to merge 4 commits into
base: feature/DWN-dimmable-fix
Choose a base branch
from

Conversation

SweVictor
Copy link
Collaborator

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 SweVictor added the help wanted Extra attention is needed label Nov 19, 2023
@SweVictor SweVictor force-pushed the feature/experimental-color-temp branch from e8a33a4 to 3975e74 Compare November 19, 2023 12:07
@seagri
Copy link

seagri commented Jul 8, 2024

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
Copy link

seagri commented Aug 16, 2024

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
Copy link

seagri commented Aug 16, 2024

I hope this is what you need.
plejd.log

@SweVictor
Copy link
Collaborator Author

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)

@seagri
Copy link

seagri commented Aug 16, 2024

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
Copy link

seagri commented Aug 22, 2024

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
Copy link

seagri commented Aug 22, 2024

tried to change color in HA
tried_to_change_color.txt

@irisityvictorhagelback
Copy link

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?

@seagri
Copy link

seagri commented Aug 23, 2024

The dimming works but not changing the color.

@seagri
Copy link

seagri commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants