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

Convert code to full integration with support for input and events from Plejd #54

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

bnordli
Copy link
Contributor

@bnordli bnordli commented Oct 2, 2021

  • The light platform is kept mostly as-is, with slightly better detection of dimmable non-dimmable lights
  • A switch platform is added, functioning exactly the same as a non-dimmable light (just a different HA UI)
  • A binary_sensor platform is added for wireless buttons (WPH-01)
  • A sensor platform is added for rotary buttons (WRT-01, VRI-02)
  • Events are added for button presses and scene activations
  • A HA service is added to trigger Plejd scenes

As part of the rewrite, the Plejd communication is isolated to the PlejdService and PlejdBus classes, and the code is rewritten to adhere to HA code standards.

Also note that the yaml configuration has changed significantly and must be rewritten if an existing installation is updated.

@bnordli bnordli mentioned this pull request Nov 1, 2021
@bnordli
Copy link
Contributor Author

bnordli commented Nov 1, 2021

After testing this weekend: I could not get the physical button inputs on the pucks to send sensible BLE messages (and even getting a Plejd ID assigned), so I had to remove binary_sensor support for those.

@dodg3r
Copy link

dodg3r commented Nov 24, 2021

Hi.
I have a REL-02 with firmware 1.0.5 that shows up as an on/off light but my other REL-02 with firmware 1.1.4 shows as a dimmer.

2021-11-24 16:03:05 DEBUG (MainThread) [custom_components.plejd.light] Turning on Taklampa garage2 (11) with brightness 00
2021-11-24 16:03:06 DEBUG (MainThread) [custom_components.plejd.plejd_service] Received message 0b0110009801000000
2021-11-24 16:03:06 DEBUG (MainThread) [custom_components.plejd.light] Taklampa garage2 (11) turned on
2021-11-24 16:03:39 DEBUG (MainThread) [custom_components.plejd.light] Turning on Fönster v.rum (22) with brightness 00
2021-11-24 16:03:40 DEBUG (MainThread) [custom_components.plejd.plejd_service] Received message 160110009801ffff00
2021-11-24 16:03:40 DEBUG (MainThread) [custom_components.plejd.light] Fönster v.rum (22) turned on with brightness ffff

@bnordli
Copy link
Contributor Author

bnordli commented Nov 24, 2021

Any output will be shown as dimmable if it at any time has reported a brightness value.

Can you go to http://ha-url/developer-tools/state and set the faulty light to color_mode: onoff and see if it stays that way or reverts to being dimmable?

@dodg3r
Copy link

dodg3r commented Nov 24, 2021

Any output will be shown as dimmable if it at any time has reported a brightness value.

Can you go to http://ha-url/developer-tools/state and set the faulty light to color_mode: onoff and see if it stays that way or reverts to being dimmable?

It reverts to dimmable after ha restart.

@bnordli
Copy link
Contributor Author

bnordli commented Dec 13, 2021

The above issue is now fixed, by making a light dimmable only if it any time its brightness values has changed.

@bnordli
Copy link
Contributor Author

bnordli commented Apr 9, 2023

This PR is now updated with the recent changes that has been merged into master. The write_data service has been tested locally. The endpoints configuration is picked up, but I haven't tried to force a specific connection.

Please consider accepting this PR or make a statement that you don't want to take it, since almost any other PR will have merge issues with this one.

@klali
Copy link
Owner

klali commented Apr 14, 2023

Hi :)

I haven't spent real time on this in some time, when/if I spend time on plejd again I will probably try to contribute to https://github.com/thomasloven/hass_plejd/ rather than continue this integration.

My only issue with this is that it adds a significant amount of code and changes to something I'm not likely to continue supporting for very long. Do you have opinions here?

@bnordli
Copy link
Contributor Author

bnordli commented Apr 14, 2023

Thanks for your input, I certainly do understand!

I also have contributed to hass_plejd and will probably migrate to that once it becomes a little more mature, so I don't really mind if you don't plan to keep supporting this project.

I just wanted to contribute back with something that has been working for me the last 18 months :)

I'll leave the PR open for others to discover the possibilities within, and let you decide if you want to merge it.

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

Successfully merging this pull request may close these issues.

3 participants