Integration with Plejd dimmers

Tried to get some help… :slight_smile:

If someone who’s running hass.io wants to try the plejd component I pushed a bluepy based branch the other day: https://github.com/klali/ha-plejd/tree/bluepy

I don’t know if the part that needs root is also problematic on hass.io, I guess it could optionally be replaced with listing the mac adresses in the configuration.

The reason for this potential change is that there seems to be a couple of bluepy based components in homeassistant proper and I’ve seen claims that they work on hass.io (for example miflora).

I’ll try to test this as soon as I get some time. I’m also using a few Mi-Flora and they are working just fine, let’s see with this.

I’ve got around 25 Plejd in my house, so I’m happy to support testing to get this to be an official integration.

General question: Does people want to see an integration with BT (like above) or against the Plejd bridge? Personally, I’d like the latter.

Would be Nice with a Bridge integration, if you have the server far away from the plejd-system

2 Likes

I would prefer a BT integration so I don’t have to by the bridge.

bridge would be best.

1 Like

I’ve also developed a Hass.io add-on for Plejd which supports auto discovery of devices and crypto key as well as BLE notifications etc.

You can find the add-on here: https://github.com/icanos/hassio-plejd

Please note that this is brand new and I’ve been running it a few days at home only, so there might be some bugs to iron out.

5 Likes

Wow! Just set this up in about 10 minutes with MQTT and the custom addon-on. Very good instructions and seems to work very well so far. Big thanks and keep up the good work! :smile:

I am running latest Hassio on RPI 3b+

Add-on version: 2
You are running the latest version of this add-on.
parse error: Expected string key before ‘:’ at line 1, column 4
[18:23:11] ERROR: Unknown HTTP error occured
System: (armv7 / raspberrypi3)
Home Assistant version: 0.102.3
Supervisor version: 192

Also noticed that when restarting hassio with ‘hassio homeassistant restart’ my plejd devices are gone and i have to go to the addon and restart it and then it works again. It just takes some time for hassio to get the state of the dimmers if the are allready turned on.

Oh, I’ll have a look at that. Could you please add an issue on GitHub? Thanks!

Could you make sure that your MQTT config looks similar to this:

mqtt:
  broker: <set by you>
  username: <set by you>
  password: <set by you>
  client_id: <set by you>
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

The birth_message part is the important one, since that is responsible of notifying the Plejd add-on that Home Assistant has started correctly.

Thank you for this, great work.

I have the same error in the log as the user above, but everything seems towork fine anyway.

Hi!

I’m running Hassi.io on raspberry pi 4.
I installed @icanos plugin and now I got this error message in the addon log:

[15:10:23] INFO: Starting the Plejd service...
[15:10:23] INFO: Verified permissions on startup script
[15:10:23] INFO: Executing startup script
[15:10:24] INFO: Wrote plejd.json
[15:10:24] INFO: Running add-on
starting Plejd add-on v. 0.2.0
plejd-api: got session token response
plejd-api: got sites response
(node:7543) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'status' of undefined
    at instance.post.then.catch (/plejd/api.js:105:111)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7543) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7543) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any ideas?
Btw, Icanos. Thanks for doing this. Appreciate it! :slight_smile:

EDIT: I solved it. I added mqtt:// before the broker ip :slight_smile: My bad.

Icanos, beautiful work.
However, I can’t get it to work, don’t understand why, running it on a Raspberry Pi 4, latest version.

Any ideas of what I’m doing wrong? Appreciate it.

I wish their was a way to install Icanos addon/solution directly on to a raspberry pi and use it as a gateway. My problem is that i have my hassio in a VM (Hyper-V) without support for usb device passthough :frowning:
Anyone else having the same issue?

Hey,

Running the Icanos addon successfully. Great stuff. Having some issues with my WPH-01.

The usecase I want to achieve is to use WPH-01 to initiate Home Assistant Scenarios. E.g. When leaving the house, I want to press one of the buttons and HA should call IFTTT to turn on my Wyze notifications and turn off all the lights using a Plejd scenario.

When the WPH-01 buttons are connected to control a unit it works fine. It registers two PID’s according to the log, and I can create HA scenarios based on events of the connected unit. E.g. turn off light X.

But, if the WPH-01 is configured to run Plejd scenarios, or if the buttons are unassigned, the WPH-01 does not work with Home Assistant Plejd addon.
I notice that it seems to discover only one button with a correct PID; but the second button registers as PID 250.

I wanted to turn on debug logging for the api.py to compare what is read, but I honestly do not know how to do that. The HA logger set to “debug” seems not to work with this addon.

I tried to place a modified copy (debug=console) of the api.py file in custom_components, but again my competence fails me. Tried multiple places, but never got my version to run.

So, can someone please help me to.

  1. Turn on debug logging for Home Assistant Plejd
  2. Tell how you use WPH-01

/Marcus

In the configfile, remove the mqtt:// so you only have the ip adress, that solved my issue.

change from broker: mqtt://192.168.1.7 to: broker: 192.168.1.7

I also wanted a way to run it without the supervisor. So I made one.

This is made to run as a separate docker container and just needs access to /var/run/dbus and your mqtt broker.

You can probably just run main.js with node too if you can’t use docker.

This is awesome!! Thanks!!

Im using @icanos integration and it works perfectly. I’m on a RPI4 now but I don’t want to worry about failed SD-cards and such, so I want to move over to a NUC. Can anyone confirm any specific model which works with the integration? I saw in the repo that some NUC didn’t have dbus support and therefore did not work.

Plejd is a central piece in my home automation setup so I need it to work. Thanks!