Code Monkey home page Code Monkey logo

hass-plejd's People

Contributors

astrandb avatar bnordli avatar newsguytor avatar oyvindwe avatar pierrei avatar thomasloven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-plejd's Issues

OUT-01 is not supported

OUT-01 is not supported, because they are unreleased, and I don't have access to any.
If you have an OUT-01 or any new device, please get in touch to help me get them supported.

First of all, thank you for a very good integration!
I'm reaching out to, if possible, help to get OUT-01 supported.

The integration founds the device and I can control temperature and brightness. I have made an automation to turn ligth on then sun goes down but by som reson the device sometimes don't respond.

Please let me know if I can be to some assistant!

config_entry-plejd-aac7e4b63e67aaf4c4a30625da5a5458.json

Skärmbild 2024-02-27 175105

Skärmbild 2024-02-27 174720

Only HA or app connects - not both at the same time.

Thank you for your efforts with this integration. It looks very promising.
However I have found a problem.
My setup is:

  • HA with a ESPHome bt-proxy (no Bluetooth in the HA server)
  • One DIM-01
  • No Plejd gateway
    I can control the dimmer as expected from the app only if I disconnect the bt-proxy and vice versa. When the bt-proxy is connected the IOS app does not connect via bluetooth. When the App is connected to the dimmer, HA/bt-proxy does not connect.

Missing double click buttons from WPH-01

The WPH-01 buttons have double click function to enable more functionality from them.

Is there a way to listen to these buttons expect creating a scene and then listening for that scene?

image

Entity names are too long

Entity names are now similar to "Plejd REL-02 {plejdName}" where {plejdName} is the name given in the Plejd app.

I think the default entity name should just be the same as in the Plejd app (like I think it was before).

Plejd integration not loaded anymore

Suddenly plejd integration stopped working. Tried to reconfigure and reload, but integration fails to load.
Upgraded to latest HA version today, and still got the same error.

`Denne feilen stammer fra en tilpasset integrasjon.

Logger: homeassistant.config_entries
Source: custom_components/plejd/init.py:29
Integration: Plejd (documentation)
First occurred: 18:37:31 (2 occurrences)
Last logged: 18:43:58

Error setting up entry xxxx for plejd
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plejd/init.py", line 29, in async_setup_entry
await plejdManager.init()
File "/usr/local/lib/python3.11/site-packages/pyplejd/init.py", line 40, in init
await self.cloud.load_site_details()
File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/init.py", line 74, in load_site_details
await self.get_details()
File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/init.py", line 63, in get_details
await _set_session_token(session, self.username, self.password)
File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/init.py", line 26, in _set_session_token
resp = await session.post(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 643, in _request
resp.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://cloud.plejd.com/parse/login')
`
image

101% brightness reported

Hello, I have this small issue where brightness is reported as 101% when at full brightness. Plejd device is DIM-01. Anyone have a solution for this? Thanks!
2023-02-15 19_54_24-Dashboard – Home Assistant
2023-02-15 19_54_57-Developer Tools – Home Assistant

Add events for RTR-01 (and other rotating dimmers)

Thanks for adding events to WPH-01! I've now been able implenent toggle on/off functionality for those switches, which makes way more sense IMO than having to press the right part of the switches to turn them on/off.

I have a bunch of RTR-01 that also would be helpful to add events to.

If the rotating motion could be made into events that would be ideal, as I could use that to control the brightness of Hue lights, but I'd also be happy with just the button press being an event.

Expose scenes as scenes instead of buttons

There are other integrations that exposes scenes as actual scenes in Home Assistant (Philips Hue, MQTT, KNX).
I propose changing the way that the Plejd integration exposes scenes to Home Assistant from buttons to scenes.
This will make the user experience more aligned with other integrations.

Integration stopped working after upgrade

After upgrade to 3.0.3 the integration wont start. Even downgrading via HACS to 3.0.1. or 3.0.0 fails with same error.

Below from HA log, and also attaching a debug log. Is it something in my end, or did something break in the update?

Logger: homeassistant.config_entries
Source: config_entries.py:399
First occurred: 00:00:21 (4 occurrences)
Last logged: 00:24:26

Error setting up entry Karpvägen 26 (19 devices) for plejd
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plejd/init.py", line 29, in async_setup_entry
await plejdManager.init()
File "/usr/local/lib/python3.11/site-packages/pyplejd/init.py", line 48, in init
self.devices = self.cloud.devices
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/init.py", line 159, in devices
outputType = const.DEVICES.HARDWARE_TYPE[hardware]
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: '-unknown- (19)'

home-assistant_plejd_2023-10-03T22-24-29.186Z.log

Reload of integration triggers all events

When I manually reload the integration (to get updated information from Plejd) all scenario and button events are triggered.

This is quite unfortunate, as this leads to all hooks for those events being triggered in HA.

This is a snapshot of my logbook just during the reload:

image

the logbook continues with all button press events being fired, then all (Plejd) scenario events being fired, then all button press events being fired (again!), then lights turning unknown (this is expected), then lights going to their actual state (also expected).

Device unavailable after update to 3a70e79 (0.0.4?)

Updated to version 3a70e79 via HACS this morning. (Diagnostic information says I have version 0.0.4 of the Plejd integration.) I only have one DIM-02-LC and it has been unavailable since.
I use a ESP32 with esphome as bluetooth proxy and have tried restarting it.

Home Assistant 2023.7.2
Supervisor 2023.07.1
Operating System 10.3
ESPHome 2023.6.5

I tried activating debug logging and then reloading the integration, this is all I get in the log:
2023-07-17 13:02:13.535 INFO (MainThread) [homeassistant.components.light] Setting up light.plejd 2023-07-17 13:02:13.535 INFO (MainThread) [homeassistant.components.switch] Setting up switch.plejd 2023-07-17 13:02:13.535 INFO (MainThread) [homeassistant.components.button] Setting up button.plejd 2023-07-17 13:02:13.543 DEBUG (MainThread) [custom_components.plejd] Ping failed 2023-07-17 13:02:23.545 DEBUG (MainThread) [custom_components.plejd] Ping failed 2023-07-17 13:02:33.546 DEBUG (MainThread) [custom_components.plejd] Ping failed

Followed by more "Ping failed".

I have NOT tried removing and re-adding the integration yet but likely will do that this evening.

Transitions

Is there a way to turn on / turn off / change brightness and temperature with a transition time?

The Plejd app has this ability through schedules, and I was hoping there is a way to set a transition time directly when communicating with the device.

error setup intergration

it discoverd the plejd ble, i can login, shows my home and 15 devices. Then no devices are entities.
running HA core 2024.5.1

Error log

2024-05-05 08:51:42.275 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry #### for plejd
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plejd/init.py", line 31, in async_setup_entry
await site.start()
File "/config/custom_components/plejd/plejd_site.py", line 83, in start
await self.manager.init(cached_site_data)
File "/usr/local/lib/python3.12/site-packages/pyplejd/init.py", line 56, in init
self.devices = self.cloud.devices
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyplejd/cloud/init.py", line 214, in devices
PlejdDevice(
File "/usr/local/lib/python3.12/site-packages/pyplejd/interface.py", line 48, in init
super().init(**data)
File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 341, in init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for PlejdDevice
outputType
unexpected value; permitted: 'LIGHT', 'SENSOR', 'RELAY', 'MOTION', 'UNKNOWN' (type=value_error.const; given=COVERABLE; permitted=('LIGHT', 'SENSOR', 'RELAY', 'MOTION', 'UNKNOWN'))

A quick update

Hi!

You may have noticed I have not put much work into this during the last couple of months.
The reason for this is twofold.
First, there's been a huge influx of stuff to do at work.

Second, and more importantly, my daughters wanted their own room, so I had to move out of my home office, and since packing that up I haven't been able to find all the hardware I was using for testing this stuff again...
I'm sure it's somewhere, and whenever I can locate it again I will pick this back up.

/ Thomas

Ghost devices

I have some ghost devices in Home Assistant that does not appear in the diagnostics file(?)

image

The devices marked in red do not have any controls, and are duplicates of the devices that are not marked with red.

Home Assistant will not let me delete the devices since they still seem to be active in the integration.

I've attached the latest diagnostics file.

config_entry-plejd-55f44f24c59b1c39068b6883956b8fcd.json.txt

Is there a way to set which bluetooth device to use?

I have problems when i expanded my Plejd network (today a total of 26 devices) that sometimes the integration stops working with the error "The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device"

I have Intel NUC with integrated Bluetooth and 3 M5Stack proxies. I belive the error is related to the M5Stacks, and I would like to test to force the integration to use the Intel BT instead, as it is located in a good spot with a lot of Plejds close by.

Is that possible?

Integration not loading with 2024.1.0b2

Testing the latest beta makes Plejd integration not load at all - probably this error is all you need?

Logger: homeassistant.config_entries
Source: config_entries.py:2087
First occurred: 15:53:59 (21 occurrences)
Last logged: 15:53:59

Error occurred loading flow for integration plejd: No module named 'home_assistant_bluetooth.models'

Expose hidden Scenarios

I have made one scenario to every switch I have. To use it to automate things in home assistant.

Is there a way to expose those, but not have them visable on the dashboard in the Plejd app?

Adding DWN-02

Hi, i curently have 18 plejd downlight in different rooms, previously these showed up as dimmers but they have now turned in to swiches. That means im unable to dim the ligts at the moment. I get that the DWN-02 might not be supported yet, but i would atleast like to get the dimming backup, and if possible the color temprature control would be an awsome addition.

Mesh re-connection flooding

I've noticed that after a while running HA with the integration it starts taking time for a change in HA to actually happen with lights/switches. While debugging I saw that the pyplejd lib used in this integration was "Trying to connect to mesh" over and over again. Not sure if this is the cause of the slowness issue or not but it looks suspicious. Is it supposed to attempt to reconnect over and over again? It seems to happen less often just after a restart but when it's been running for a day this fills the logs completely.

Excerpt from the logs when debug logging is on:

2024-05-10 09:27:19.148 DEBUG (MainThread) [pyplejd.ble] Pong(51)
2024-05-10 09:27:19.148 DEBUG (MainThread) [pyplejd.ble] Polling mesh for current state
2024-05-10 09:27:19.786 DEBUG (MainThread) [pyplejd.ble] Trying to connect to mesh
2024-05-10 09:27:19.786 DEBUG (MainThread) [pyplejd.ble] Ping(197)
2024-05-10 09:27:20.307 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 0b0000232907070023290c000023260707002326
2024-05-10 09:27:20.308 DEBUG (MainThread) [pyplejd.ble] Address: 11, state: False, dim: 1799
2024-05-10 09:27:20.308 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0b\x00\x00#)\x07\x07\x00#)')
2024-05-10 09:27:20.309 DEBUG (MainThread) [pyplejd.ble] Address: 12, state: False, dim: 1799
2024-05-10 09:27:20.309 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0c\x00\x00#&\x07\x07\x00#&')
2024-05-10 09:27:21.267 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 0d000002d000000000000e000002d10000000000
2024-05-10 09:27:21.268 DEBUG (MainThread) [pyplejd.ble] Address: 13, state: False, dim: 0
2024-05-10 09:27:21.268 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\r\x00\x00\x02\xd0\x00\x00\x00\x00\x00')
2024-05-10 09:27:21.269 DEBUG (MainThread) [pyplejd.ble] Address: 14, state: False, dim: 0
2024-05-10 09:27:21.269 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0e\x00\x00\x02\xd1\x00\x00\x00\x00\x00')
2024-05-10 09:27:21.467 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 100000232bff7f00232b11000023237d7d002323
2024-05-10 09:27:21.468 DEBUG (MainThread) [pyplejd.ble] Address: 16, state: False, dim: 32767
2024-05-10 09:27:21.469 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x10\x00\x00#+\xff\x7f\x00#+')
2024-05-10 09:27:21.469 DEBUG (MainThread) [pyplejd.ble] Address: 17, state: False, dim: 32125
2024-05-10 09:27:21.470 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x11\x00\x00##}}\x00##')
2024-05-10 09:27:21.787 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 130000232dffff00232d140000232ef02800232e
2024-05-10 09:27:21.788 DEBUG (MainThread) [pyplejd.ble] Address: 19, state: False, dim: 65535
2024-05-10 09:27:21.788 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x13\x00\x00#-\xff\xff\x00#-')
2024-05-10 09:27:21.789 DEBUG (MainThread) [pyplejd.ble] Address: 20, state: False, dim: 10480
2024-05-10 09:27:21.789 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x14\x00\x00#.\xf0(\x00#.')
2024-05-10 09:27:21.987 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1600002325b082002325170000232a000000232a
2024-05-10 09:27:21.988 DEBUG (MainThread) [pyplejd.ble] Address: 22, state: False, dim: 33456
2024-05-10 09:27:21.988 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x16\x00\x00#%\xb0\x82\x00#%')
2024-05-10 09:27:21.989 DEBUG (MainThread) [pyplejd.ble] Address: 23, state: False, dim: 0
2024-05-10 09:27:21.989 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x17\x00\x00#*\x00\x00\x00#*')
2024-05-10 09:27:22.627 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 19000023271d1d0023271a000023220000002322
2024-05-10 09:27:22.628 DEBUG (MainThread) [pyplejd.ble] Address: 25, state: False, dim: 7453
2024-05-10 09:27:22.628 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b"\x19\x00\x00#\'\x1d\x1d\x00#\'")
2024-05-10 09:27:22.628 DEBUG (MainThread) [pyplejd.ble] Address: 26, state: False, dim: 0
2024-05-10 09:27:22.629 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1a\x00\x00#"\x00\x00\x00#"')
2024-05-10 09:27:22.787 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1b000023241d1d0023241d000023280000002328
2024-05-10 09:27:22.788 DEBUG (MainThread) [pyplejd.ble] Address: 27, state: False, dim: 7453
2024-05-10 09:27:22.788 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1b\x00\x00#$\x1d\x1d\x00#$')
2024-05-10 09:27:22.789 DEBUG (MainThread) [pyplejd.ble] Address: 29, state: False, dim: 0
2024-05-10 09:27:22.789 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1d\x00\x00#(\x00\x00\x00#(')
2024-05-10 09:27:23.787 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1e0000232c000000232c
2024-05-10 09:27:23.788 DEBUG (MainThread) [pyplejd.ble] Address: 30, state: False, dim: 0
2024-05-10 09:27:23.788 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1e\x00\x00#,\x00\x00\x00#,')
2024-05-10 09:27:24.108 DEBUG (MainThread) [pyplejd.ble] Pong(198)
2024-05-10 09:27:24.108 DEBUG (MainThread) [pyplejd.ble] Polling mesh for current state
2024-05-10 09:27:24.347 DEBUG (MainThread) [pyplejd.ble] Trying to connect to mesh
2024-05-10 09:27:24.348 DEBUG (MainThread) [pyplejd.ble] Ping(0)
2024-05-10 09:27:24.427 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 0b0000232907070023290c000023260707002326
2024-05-10 09:27:24.427 DEBUG (MainThread) [pyplejd.ble] Address: 11, state: False, dim: 1799
2024-05-10 09:27:24.428 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0b\x00\x00#)\x07\x07\x00#)')
2024-05-10 09:27:24.428 DEBUG (MainThread) [pyplejd.ble] Address: 12, state: False, dim: 1799
2024-05-10 09:27:24.428 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0c\x00\x00#&\x07\x07\x00#&')
2024-05-10 09:27:24.747 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 0d000002d000000000000e000002d10000000000
2024-05-10 09:27:24.748 DEBUG (MainThread) [pyplejd.ble] Address: 13, state: False, dim: 0
2024-05-10 09:27:24.748 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\r\x00\x00\x02\xd0\x00\x00\x00\x00\x00')
2024-05-10 09:27:24.749 DEBUG (MainThread) [pyplejd.ble] Address: 14, state: False, dim: 0
2024-05-10 09:27:24.749 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0e\x00\x00\x02\xd1\x00\x00\x00\x00\x00')
2024-05-10 09:27:24.947 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 100000232bff7f00232b11000023237d7d002323
2024-05-10 09:27:24.948 DEBUG (MainThread) [pyplejd.ble] Address: 16, state: False, dim: 32767
2024-05-10 09:27:24.948 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x10\x00\x00#+\xff\x7f\x00#+')
2024-05-10 09:27:24.949 DEBUG (MainThread) [pyplejd.ble] Address: 17, state: False, dim: 32125
2024-05-10 09:27:24.950 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x11\x00\x00##}}\x00##')
2024-05-10 09:27:25.387 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 130000232dffff00232d140000232ef02800232e
2024-05-10 09:27:25.388 DEBUG (MainThread) [pyplejd.ble] Address: 19, state: False, dim: 65535
2024-05-10 09:27:25.388 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x13\x00\x00#-\xff\xff\x00#-')
2024-05-10 09:27:25.388 DEBUG (MainThread) [pyplejd.ble] Address: 20, state: False, dim: 10480
2024-05-10 09:27:25.389 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x14\x00\x00#.\xf0(\x00#.')
2024-05-10 09:27:25.707 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1600002325b082002325170000232a000000232a
2024-05-10 09:27:25.708 DEBUG (MainThread) [pyplejd.ble] Address: 22, state: False, dim: 33456
2024-05-10 09:27:25.708 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x16\x00\x00#%\xb0\x82\x00#%')
2024-05-10 09:27:25.709 DEBUG (MainThread) [pyplejd.ble] Address: 23, state: False, dim: 0
2024-05-10 09:27:25.709 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x17\x00\x00#*\x00\x00\x00#*')
2024-05-10 09:27:25.747 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 19000023271d1d0023271a000023220000002322
2024-05-10 09:27:25.748 DEBUG (MainThread) [pyplejd.ble] Address: 25, state: False, dim: 7453
2024-05-10 09:27:25.748 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b"\x19\x00\x00#\'\x1d\x1d\x00#\'")
2024-05-10 09:27:25.750 DEBUG (MainThread) [pyplejd.ble] Address: 26, state: False, dim: 0
2024-05-10 09:27:25.750 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1a\x00\x00#"\x00\x00\x00#"')
2024-05-10 09:27:25.827 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1b000023241d1d0023241d000023280000002328
2024-05-10 09:27:25.828 DEBUG (MainThread) [pyplejd.ble] Address: 27, state: False, dim: 7453
2024-05-10 09:27:25.828 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1b\x00\x00#$\x1d\x1d\x00#$')
2024-05-10 09:27:25.829 DEBUG (MainThread) [pyplejd.ble] Address: 29, state: False, dim: 0
2024-05-10 09:27:25.829 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1d\x00\x00#(\x00\x00\x00#(')
2024-05-10 09:27:26.706 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1e0000232c000000232c
2024-05-10 09:27:26.707 DEBUG (MainThread) [pyplejd.ble] Address: 30, state: False, dim: 0
2024-05-10 09:27:26.707 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1e\x00\x00#,\x00\x00\x00#,')
2024-05-10 09:27:26.867 DEBUG (MainThread) [pyplejd.ble] Pong(1)
2024-05-10 09:27:26.867 DEBUG (MainThread) [pyplejd.ble] Polling mesh for current state
2024-05-10 09:27:27.187 DEBUG (MainThread) [pyplejd.ble] Trying to connect to mesh
2024-05-10 09:27:27.188 DEBUG (MainThread) [pyplejd.ble] Ping(109)
2024-05-10 09:27:27.228 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 0b0000232907070023290c000023260707002326
2024-05-10 09:27:27.229 DEBUG (MainThread) [pyplejd.ble] Address: 11, state: False, dim: 1799
2024-05-10 09:27:27.229 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0b\x00\x00#)\x07\x07\x00#)')
2024-05-10 09:27:27.230 DEBUG (MainThread) [pyplejd.ble] Address: 12, state: False, dim: 1799
2024-05-10 09:27:27.230 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0c\x00\x00#&\x07\x07\x00#&')
2024-05-10 09:27:27.386 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 0d000002d000000000000e000002d10000000000
2024-05-10 09:27:27.386 DEBUG (MainThread) [pyplejd.ble] Address: 13, state: False, dim: 0
2024-05-10 09:27:27.386 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\r\x00\x00\x02\xd0\x00\x00\x00\x00\x00')
2024-05-10 09:27:27.386 DEBUG (MainThread) [pyplejd.ble] Address: 14, state: False, dim: 0
2024-05-10 09:27:27.387 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x0e\x00\x00\x02\xd1\x00\x00\x00\x00\x00')
2024-05-10 09:27:27.547 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 100000232bff7f00232b11000023237d7d002323
2024-05-10 09:27:27.548 DEBUG (MainThread) [pyplejd.ble] Address: 16, state: False, dim: 32767
2024-05-10 09:27:27.548 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x10\x00\x00#+\xff\x7f\x00#+')
2024-05-10 09:27:27.549 DEBUG (MainThread) [pyplejd.ble] Address: 17, state: False, dim: 32125
2024-05-10 09:27:27.549 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x11\x00\x00##}}\x00##')
2024-05-10 09:27:28.027 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 130000232dffff00232d140000232ef02800232e
2024-05-10 09:27:28.027 DEBUG (MainThread) [pyplejd.ble] Address: 19, state: False, dim: 65535
2024-05-10 09:27:28.027 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x13\x00\x00#-\xff\xff\x00#-')
2024-05-10 09:27:28.028 DEBUG (MainThread) [pyplejd.ble] Address: 20, state: False, dim: 10480
2024-05-10 09:27:28.028 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x14\x00\x00#.\xf0(\x00#.')
2024-05-10 09:27:28.667 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1600002325b082002325170000232a000000232a
2024-05-10 09:27:28.668 DEBUG (MainThread) [pyplejd.ble] Address: 22, state: False, dim: 33456
2024-05-10 09:27:28.668 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x16\x00\x00#%\xb0\x82\x00#%')
2024-05-10 09:27:28.669 DEBUG (MainThread) [pyplejd.ble] Address: 23, state: False, dim: 0
2024-05-10 09:27:28.669 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x17\x00\x00#*\x00\x00\x00#*')
2024-05-10 09:27:28.827 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 19000023271d1d0023271a000023220000002322
2024-05-10 09:27:28.828 DEBUG (MainThread) [pyplejd.ble] Address: 25, state: False, dim: 7453
2024-05-10 09:27:28.828 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b"\x19\x00\x00#\'\x1d\x1d\x00#\'")
2024-05-10 09:27:28.829 DEBUG (MainThread) [pyplejd.ble] Address: 26, state: False, dim: 0
2024-05-10 09:27:28.829 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1a\x00\x00#"\x00\x00\x00#"')
2024-05-10 09:27:29.187 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1b000023241d1d0023241d000023280000002328
2024-05-10 09:27:29.188 DEBUG (MainThread) [pyplejd.ble] Address: 27, state: False, dim: 7453
2024-05-10 09:27:29.188 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1b\x00\x00#$\x1d\x1d\x00#$')
2024-05-10 09:27:29.189 DEBUG (MainThread) [pyplejd.ble] Address: 29, state: False, dim: 0
2024-05-10 09:27:29.189 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1d\x00\x00#(\x00\x00\x00#(')
2024-05-10 09:27:29.827 DEBUG (MainThread) [pyplejd.ble] Parsing LIGHTLEVEL: 1e0000232c000000232c
2024-05-10 09:27:29.828 DEBUG (MainThread) [pyplejd.ble] Address: 30, state: False, dim: 0
2024-05-10 09:27:29.828 DEBUG (MainThread) [pyplejd.ble] LL message: bytearray(b'\x1e\x00\x00#,\x00\x00\x00#,')
2024-05-10 09:27:30.147 DEBUG (MainThread) [pyplejd.ble] Pong(110)

WMS-01 stuck in motion

In PLEJD APP the detector detects when movements and go back to normal. But in HA it's stuck for about 30-40 seconds in motion. Is there a way to make it follow more accurate?

Switch as light

Hi,

I see in the const.py file of the pyplejd package that relays like REL-01-2P are defined as switches.
However, in Home Assistant the REL-01-2P is shown as a light. Is this because the device was created with an earlier version of hass_plejd, or are relays created as lights from the hass_plejd integration?

My point is that relays should be created as switches in Home Assistant. If the switch then actually controls a light, "Switch as X" should be used in Home Assistant to replace the switch with a light device. :)

Feature request: Events

Thanks for creating this awesome project!

Would it be possible to send events to the event bus or similar to be able to automate on specific events on the Plejd mesh?

It would be really useful to create automations on events like this one:
[custom_components.plejd.pyplejd.mesh] Scene triggered: {'scene': 9}

This event could trigger an automation to do additional scene activations or disabling/enabling other automations in Home Assistant.

DAL-01 brightness control

Can you add support for brightness control for Plejd DAL-01 dimmers? The Plejd-Hassio integration has this.

Spamming of log

During this morning I got this sequence repeated almost 28000 times in home-assistant.log.
The problem disappeared after restart of HA. I shall see if I can understand what happened, but anyway it is not very productive to have this intensive spamming of the log.

2022-10-30 11:59:48.186 DEBUG (MainThread) [custom_components.plejd.pyplejd.mesh] Trying to connect to mesh
2022-10-30 11:59:48.186 DEBUG (MainThread) [custom_components.plejd.pyplejd.mesh] Connecting to DA:1B:E8:5A:3A:05: P mesh
2022-10-30 11:59:48.187 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Error connecting to Plejd device: plejd - DA:1B:E8:5A:3A:05: Failed to connect: No device found for address DA:1B:E8:5A:3A:05
2022-10-30 11:59:48.189 DEBUG (MainThread) [custom_components.plejd.pyplejd.mesh] Connecting to FE:FE:3D:C2:EC:E6: P mesh
2022-10-30 11:59:48.191 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Error connecting to Plejd device: plejd - FE:FE:3D:C2:EC:E6: Failed to connect: No backend with an available connection slot that can reach address FE:FE:3D:C2:EC:E6 was found
2022-10-30 11:59:48.193 DEBUG (MainThread) [custom_components.plejd.pyplejd.mesh] Connecting to DA:1B:E8:5A:3A:05: P mesh
2022-10-30 11:59:48.196 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Error connecting to Plejd device: plejd - DA:1B:E8:5A:3A:05: Failed to connect: No device found for address DA:1B:E8:5A:3A:05
2022-10-30 11:59:48.197 DEBUG (MainThread) [custom_components.plejd.pyplejd.mesh] Connecting to FD:66:51:6E:7D:AC: P mesh
2022-10-30 11:59:48.199 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Error connecting to Plejd device: plejd - FD:66:51:6E:7D:AC: Failed to connect: No device found for address FD:66:51:6E:7D:AC
2022-10-30 11:59:48.201 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Failed to connect to plejd mesh - [DA:1B:E8:5A:3A:05: P mesh, FE:FE:3D:C2:EC:E6: P mesh, DA:1B:E8:5A:3A:05: P mesh, FD:66:51:6E:7D:AC: P mesh]
2022-10-30 11:59:48.202 DEBUG (MainThread) [custom_components.plejd] Ping failed

CTR-01, REL-02 domain types, no access to 0-10v

My CTR-01 that is configured as relay other (not relay light) turns up as a switch in ha.
The switch domain does not give access to the 0-10v output of the CTR-01.
I currently use the output to control a fan.
I understand that I could wrap the switch in fan entity using template, but that would not give me access to 0-10v output.
I could change the type in plejd configuration to relay light, but that would disable the timer feature of plejd....
Maybe it would be prefered to always use the light domain in ha?

The REL-02 configured as relay light gives you access to brightness which does not exist on the REL-02 since it does not have a 0-10v output.
This can possibly be wrapped in a switch using template to hide the brightness

Dropped connection after HAOS 11 upgrade

Thanks for a great integration, and all your other contributions aswell, Thomas.

Unfortunately after upgrading to HAOS 11.0 the connection to the mesh is dropped resulting in entities getting unavailable every other minute.

IMG_5179

I get the following messages in the logs:

Logger: pyplejd.ble
Source: runner.py:186
First occurred: 22:58:42 (27 occurrences)
Last logged: 23:01:45

Plejd mesh keepalive signal failed: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Unlikely Error)
Plejd mesh keepalive signal failed: [org.bluez.Error.Failed] Not connected.

—-

Logger: pyplejd.ble
Source: custom_components/plejd/light.py:82
Integration: Plejd (documentation)
First occurred: 22:58:42 (7 occurrences)
Last logged: 23:07:23

Writing to plejd mesh failed: [org.bluez.Error.Failed] Not connected
Writing to plejd mesh failed: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Unlikely Error)

—-

Logger: pyplejd.ble
Source: custom_components/plejd/light.py:86
Integration: Plejd (documentation)
First occurred: 23:00:29 (1 occurrences)
Last logged: 23:00:29

Writing to plejd mesh failed: [org.bluez.Error.Failed] Not connected

I am using HAOS 11.0, HA 2023.10.3 and Plejd 0.3.5 on a Intel NUC.
Please let me know if you want any more info.

Devices go offline intermittently

All my Plejd devices become unavailable intermittently. Most often just a few seconds but it has happened for up to 10 minutes as well.
It happens to all devices at the same time.

I have a BT-500 Bluetooth adapter.
The logs didn’t show anything. I have a Yale Doorman L3 connected through Bluetooth as well and it stays available, so the issue isn’t the Bluetooth integration.

IMG_3123

Home assistant Core 2023.3.2 - Inaccessible

Hi!

Updated my system to 2023.3.2 today and cant get my plejd lights to work again. worked perfectly before but now it just shows as "Inaccessible" i have tried to remove the integration and add it again and that works and i find all my lights but status is still "inaccessible"
Is this just at my end or is it something that broke in the latest update?

Won't start if no access to Plejd API at boot

Hello,
First, thanks for this integration which works perfect for me!

Noticed an issue when HA was restarted while we had an Internet outage, then no connection to Plejd mesh.
Could a fallback to use already stored info when/if Plejd API is unavailable be added?
In the spirit of local access :)

This error originated from a custom integration.


Logger: homeassistant.config_entries 
Source: custom_components/plejd/__init__.py:26 
Integration: Plejd (documentation) 
First occurred: 09:39:33 (1 occurrences) 
Last logged: 09:39:33 

Error setting up entry <my-plejd-site-name> for plejd 
Traceback (most recent call last): 
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1155, in _create_direct_connection 
hosts = await asyncio.shield(host_resolved) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 874, in _resolve_host 
addrs = await self._resolver.resolve(host, port, family=self._family) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/site-packages/aiohttp/resolver.py", line 33, in resolve 
infos = await self._loop.getaddrinfo( 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo 
return await self.run_in_executor( 
^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run 
result = self.fn(*self.args, **self.kwargs) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo 
for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

socket.gaierror: [Errno -3] Try again 
The above exception was the direct cause of the following exception: 
Traceback (most recent call last): 
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup 
result = await component.async_setup_entry(hass, self) 

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/config/custom_components/plejd/__init__.py", line 26, in async_setup_entry 
await plejdManager.init() 
File "/usr/local/lib/python3.11/site-packages/pyplejd/__init__.py", line 35, in init 
await self.cloud.ensure_details_loaded() 
File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/__init__.py", line 75, in ensure_details_loaded 
await self.get_details() 

File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/__init__.py", line 63, in get_details 
await _set_session_token(session, self.username, self.password) 

File "/usr/local/lib/python3.11/site-packages/pyplejd/cloud/__init__.py", line 26, in _set_session_token 
resp = await session.post( 
^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request 
conn = await self._connector.connect( 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect 
proto = await self._create_connection(req, traces, timeout) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection 
_, proto = await self._create_direct_connection(req, traces, timeout) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1169, in _create_direct_connection 
raise ClientConnectorError(req.connection_key, exc) from exc 
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host cloud.plejd.com:443 ssl:default [Try again] 

Plejd mesh keepalive signal failed

I use Plejd in my Home Assistant (HAOS) on RPi 3b.
I have installed hass_plejd custom component from HACS.
I use an ESP32 as bluetooth proxy, which connects to my Plejd installation.

This works for a good while, several days or weeks. Then suddenly it starts logging this every 10 seconds in home-assistant.log:

2023-04-04 18:33:17.912 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Plejd mesh keepalive signal failed: Not connected to esp32-1 @ 192.168.10.119!
2023-04-04 18:33:27.920 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Plejd mesh keepalive signal failed: Not connected to esp32-1 @ 192.168.10.119!
2023-04-04 18:33:37.927 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Plejd mesh keepalive signal failed: Not connected to esp32-1 @ 192.168.10.119!
2023-04-04 18:33:47.935 WARNING (MainThread) [custom_components.plejd.pyplejd.mesh] Plejd mesh keepalive signal failed: Not connected to esp32-1 @ 192.168.10.119!

To fix this, I need to restart the entire RPi. It isn't enough to restart the ESP32, nor Home Assistant.

Device CTR-01

Hi,
First, thanks for making this.
I just switch from hassio-plejd on RPi4 (HASSOS) to this on docker using ESP32. Very happy :)

Noticed that Plejd CTR-01 is set to non-dimmable.
The device can act as relay but also dim depending on its config.

I changed dimmable to True, works great https://github.com/thomasloven/hass_plejd/blob/49e97e0a72cd65a026ee8919d6b14dc04906fded/custom_components/plejd/pyplejd/plejd_device.py#L19

If acting as a relay Plejd hopefully tells (?)
https://github.com/thomasloven/hass_plejd/blob/49e97e0a72cd65a026ee8919d6b14dc04906fded/custom_components/plejd/pyplejd/api.py#L86-L87

Integration worked once, now not at all

Got this up and running.
After what I think was a normal restart it doesn't work anymore.

Devices is discovered, but is all unavailable

Logs say NOTHING!!

Home assistant 2023.10.1
OS 10.5
RPI 3B+

Have tried:
Reloading integration.
Removing integration
Removing files from custom_components
Loaded an old backup from before I installed it the first time

Edit
The problem seems to be that the plejd-mesh is not auto discovered.
Logs still says nothing

WRT-01 shows up with duplicate light entity

I get a duplicate light entity for each of my WRT-01 devices.

I have 2 WRT-01 controlling the same DIM-01 device, and for this device I get 3 light entities. I can control the light from all 3 entities, but the entity from one of the switches resets to off if used to turn on.

I think the fix is to not create light entities form WRT-01 devices. I'm happy to try to fix this issue.

Error during attempt to load integration.

Logger: homeassistant.loader
Source: custom_components/plejd/init.py:13
Integration: Plejd BLE (documentation, issues)
First occurred: 23:37:43 (6 occurrences)
Last logged: 23:47:33

Unexpected exception importing platform custom_components.plejd.config_flow
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 779, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 796, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/plejd/init.py", line 13, in
PLATFORMS = [Platform.LIGHT, Platform.SWITCH, Platform.SCENE, Platform.EVENT, Platform.BINARY_SENSOR]
File "/usr/lib/python3.10/enum.py", line 437, in getattr
raise AttributeError(name) from None
AttributeError: EVENT

Suppport for two different mesh?

Hi! I have a special situation with two different mesh, one in the house and one on the garage because of physical distance. The house one is using the integration flawlessly and all plejd pucks are autodiscovered and work. Now, I'm trying to use the Theengsgateway (BT to MQTT) to discover as well the plejd mesh in the garage and I can see that the BT gw does see the Plejd puck even if it does not add it as lights in the autodiscovery topic (I've asked about that in another thread). Will the integration be able to discover the second mesh and add it if home assistant adds the single Plejd puck in the garage mesh as a light in the autodiscovery topic? Will it then start a second integration instance or arr the second mesh to the same instance? Thanks!

jal-01 still unsuported

the jal-01 is still unsupported.

got error:

Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 20:39:20 (4 occurrences)
Last logged: 20:45:21

Error setting up entry Thuis for plejd
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plejd/init.py", line 31, in async_setup_entry
await site.start()
File "/config/custom_components/plejd/plejd_site.py", line 83, in start
await self.manager.init(cached_site_data)
File "/usr/local/lib/python3.12/site-packages/pyplejd/init.py", line 56, in init
self.devices = self.cloud.devices
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyplejd/cloud/init.py", line 214, in devices
PlejdDevice(
File "/usr/local/lib/python3.12/site-packages/pyplejd/interface.py", line 48, in init
super().init(**data)
File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 341, in init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for PlejdDevice
outputType
unexpected value; permitted: 'LIGHT', 'SENSOR', 'RELAY', 'MOTION', 'UNKNOWN' (type=value_error.const; given=COVERABLE; permitted=('LIGHT', 'SENSOR', 'RELAY', 'MOTION', 'UNKNOWN'))

"Software caused connection abort"

I get the following error when trying to setup plejd.
Logger: custom_components.plejd.pyplejd.mesh
Source: custom_components/plejd/pyplejd/mesh.py:86
Integration: Plejd
First occurred: 21:19:46 (1 occurrences)
Last logged: 21:19:46

Error connecting to Plejd device: plejd - E3:FA:36:97:C3:BC: Failed to connect: [org.bluez.Error.Failed] Software caused connection abort

Also, I always end up getting two integrations

Multiple copies of integrations shown upon bluetooth discovery

This happened when I wanted to start from a clean slate by deleting the integration and setting it up again.

image

HA is probably listing one copy of the integration per device/puck which offers the Plejd service, but since it is a mesh, it doesn't make sense to list more than one.

(This list is still present after configuring, but goes away after a restart.)

Plejd buttons (WPH-01) are unavailable

I've installed this, and it mostly works fine, but my two WPH-01 (Firmware: 0.4.0) switches are unavailable.

I've enabled debug logging, but I still don't see anything in the log.

Hidden switches don't show up

I just tried out the project and boy does it work well! Apart from one thing :D

I have a few switches (SPR-01) that are configured in the Plejd app to be hidden from the room they're in. These do not show up in HA at all. I have to un-hide them in the Plejd app and restart HA, then they show up. Would be amazing if devices for these switches were created in HA and set to hidden there when they are hidden in Plejd.

Thanks for a great project!

Connection lost and not reconnecting

After every few days, I loose connection to the mesh, and it fails to reconnect. Whenever this happens, I need to restart HA to reconnect. I am happy to help out debugging, but I'm not sure where to start.

Home Assistant 2023.1.2 (but this problem has been since i started using the integration).

2023-01-10 23:23:41.196 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 96, in _async_wrap_bluetooth_operation
    return await func(self, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 540, in write_gatt_char
    await self._client.bluetooth_gatt_write(
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 667, in bluetooth_gatt_write
    await self._send_bluetooth_message_await_response(
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 440, in _send_bluetooth_message_await_response
    raise BluetoothGATTAPIError(BluetoothGATTError.from_pb(resp[0]))
aioesphomeapi.core.BluetoothGATTAPIError: Bluetooth GATT Error address=DE:B2:68:ED:E5:0D handle=40 error=-1 description=Not connected

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/plejd/__init__.py", line 98, in _ping
    if not await plejdManager.keepalive():
  File "/config/custom_components/plejd/pyplejd/__init__.py", line 75, in keepalive
    retval = await self.mesh.ping()
  File "/config/custom_components/plejd/pyplejd/mesh.py", line 159, in ping
    return await self._ping()
  File "/config/custom_components/plejd/pyplejd/mesh.py", line 167, in _ping
    await self.client.write_gatt_char(PLEJD_PING, ping, response=True)
  File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 593, in write_gatt_char
    await self._backend.write_gatt_char(char_specifier, data, response)
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 79, in _async_wrap_bluetooth_connected_operation
    await task
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 117, in _async_wrap_bluetooth_operation
    self._async_ble_device_disconnected()
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 197, in _async_ble_device_disconnected
    self._async_disconnected_cleanup()
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 192, in _async_disconnected_cleanup
    self._unsubscribe_connection_state()
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 168, in _unsubscribe_connection_state
    self._cancel_connection_state()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 534, in unsub
    self._connection.remove_message_callback(on_msg, msg_types)
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 455, in remove_message_callback
    self._message_handlers[msg_type].remove(on_message)
KeyError: <class 'api_pb2.BluetoothDeviceConnectionResponse'>

Some performance and integration issues

I tried to get this working with some Plejd dimmers, but cant really get it working. In the start I tried with the gateway, then removed the gateway. HA finds the dimmers, they include, but HA cant connect to the mesh. When I used the gateway it managed to connect to the mesh, but the response was so delayed. Is it supposed to be direct response as I wanted to control the hue lights with the dimmers in realtime, but this one for me is 2-10 seconds delayed. Also after the dimmer is located in HA, and added the entity is grayed out, and never goes online

Issue with naming of the "parent device"

There is a logical issue with naming of the parent device when the device has two outputs in different rooms.
I have a Plejd DIM-02 with outputs in two different rooms on two different floors. This creates some issues in the naming of the device in the Plejd integration and the configured area in Home Assistant integration.

If I try to change the area in Home Assistant of one of the outputs (lights), the parent device also changes area, thus changing the area for both outputs of the device in the operation.

In the example below I have a DIM-02 that originally was named "Taklampe Soverom" by the Plejd integration with one output enabled initially, - also called "Taklampe Soverom". I then configured output 2 as a dummy output as a workaround do scene events in Home Asisstant without actually making changes on the lights in the house. Suddenly the parent device is called "Dummy" with the outputs (lights) "Taklampe Soverom" and "Dummy". If I change the area of the "Dummy"-light to another room, the parent device also changes area".

bilde bilde bilde

2023.6 beta warning

/config/custom_components/plejd/pyplejd/mesh.py:71: FutureWarning: BLEDevice.rssi is deprecated and will be removed in a future version of Bleak, use AdvertisementData.rssi instead self.mesh_nodes.sort(key = lambda a: a.rssi, reverse = True)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.