Plugwise Plugs component

I’ve updated the starting post with the link to the files and a short install instruction.

1 Like

The missing Circles should be appear as soon as they’re reachable. The v1.0.1 version will try to communicate and detect the device type during the first hour at every update cycle, thereafter it will try once an hour. As soon as communication/detection is succesfull the plug will be added to HA automatically. No restart required for this. :wink:

I like your suggestion to use the legacy logo instead.

This in the log:

> 2020-07-26 10:42:40 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for plugwise_stick which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
> 2020-07-26 10:42:40 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for breaking_changes which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
> 2020-07-26 10:42:40 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
> 2020-07-26 10:42:56 WARNING (Thread-2) [plugwise] Reset clock of node ################ because time has drifted -16603 sec
> 2020-07-26 10:43:30 WARNING (Thread-3) [plugwise] Failed to discover registered Plugwise node with MAC '################' before timeout expired.
> 2020-07-26 10:43:30 WARNING (Thread-3) [plugwise] Failed to discover registered Plugwise node with MAC '################' before timeout expired.
> 2020-07-26 10:43:30 WARNING (Thread-3) [plugwise] Failed to discover registered Plugwise node with MAC '################' before timeout expired.

Two of them are really close to the Circle+ and to the others… At this moment I don’t know why they can’t be found.

I have also the other issue; when the value is 0 the state goes to unknown, when there is a value it’s displaying this correct and then goes back to unknown.

I came across this topic: Attribute with value 0 shown as "unknown"

I did solve this isssue at my local installation by making sure the backend lib “pushes” a value update and present the updated value of 0. This changes the state value from unknown to 0.
Currently busy to get all the bits and pieces ready to have an updated integration (and depending backend library) available in HACS.

:shushing_face: The upcoming version will expose two additional sensors for both the inbound and outbound signal strength levels. Both sensors are disabled by default, so you have to enable them from the UI manually.

1 Like

I’ve requested to add the “Plugwise USB-stick” integration to HACS.
If you can’t wait => manually add https://github.com/brefra/home-assistant-plugwise-stick as “custom repository” in HACS. :yum: Edit: The integration is now available in HACS

Updates in the version available in HACS:

  • Adds two addional sensors for the RSSI levels. Be aware those are default disabled.
  • Fixes most of the “Unknown” issue

At the “To Do” list:

  • Fix the “Unkown” issue for the general “power usage” sensor. Just noticed I missed this one. :thinking:
  • Add proper change log/versioning to the HACS integration doc.
  • Fix “Entity ID already exists…” messages when a device is discovered after a discover failure during startup of the integration.
  • Add linking/registration of new devices (and removal)
  • Add support for other devices (Scan, Sense, Sting)
  • Any other feature request??
1 Like

Great, thanks!

After installing the latest version I’m seeing two “unknown” values:
sensor.power_consumption_current_hour_xy1z2 and
sensor.power_usage_xy1z2

I’ve now installed it via HACS! Works great and now with the new plugwise images :blush:
Actual power usage read is the thing I mostly use, as you said this is still giving a lot of times Unknown.

Thanks a lot!

I’ve just released an updated version (1.2.0) of this integration in HACS:-

Fixes

  • Solve the “unknown” issue when the measured power consumption remains at 0 since start-up.
  • Make devices properly available afterwards when they are not online during the startup of Home Assistant.
1 Like

Great, just installed through HACS, works fine.

Only thing to complain about is the Plugwise logo being used. It seems the logo has a white background instead of transparant. On default white theme this is fine, but when using a dark theme it looks like this:

image

PS another minor thing, the Stealth devices are still detected as Circle

1 Like

Ok, you’re apparently running the 114 beta release. Indeed I have to fix the logo background. Thanks for reporting.

I’m still busy to figure out a different way to detect the difference between the Circle and Stealth devices. Currently the device type is based on reported hardware ID, which is the circle one for your stealth devices.

After updating to the new version, I’m seeing this in Logs:

Log Details (ERROR)
Logger: python-plugwise
Source: /usr/local/lib/python3.8/site-packages/plugwise/stick.py:81
First occurred: 9:57:23 AM (1 occurrences)
Last logged: 9:57:23 AM

###>- dept version -<###
1 Like

:grimacing: forgot to remove this log entry before building/publishing the backend lib
Fortunately it doesn’t harm in any way. It’s only one log entry during startup. Please ignore it for now, I’ll fix it in next release.
Thanks for reporting :+1:

After updating to Core 0.114.0, I’m seeing this in Logs:

Log Details (ERROR)
Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:313
First occurred: 2:57:56 PM (1 occurrences)
Last logged: 2:57:56 PM

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/plugwise/stick.py", line 701, in _watchdog_loop
    if not self.connection.read_thread_alive():
  File "/usr/local/lib/python3.8/site-packages/plugwise/connections/connection.py", line 103, in read_thread_alive
    return self._reader_thread.isAlive() if run_reader_thread else False
NameError: name 'run_reader_thread' is not defined

Thanks @bouwew for reporting the exception.
I’ve fixed this in the updated v1.2.1 release. Please update the custom Integration from HACS.

1 Like

@brefa, an observation and some feedback, if you don’t mind :slight_smile:

I see you are showing as an attribute the “today_energy_kwh” value. When looking at the value: 0.002 at the moment, and looking at my own sensor for the same entity: 2.2, it looks like your value is a factor 1000 wrong.

I also see that you are showing the device_class “outlet” as an attribute.
FYI, switches don’t have device classes, see here: https://www.home-assistant.io/docs/configuration/customizing-devices/#device-class
Click on each entity to see the allowed device_classes per type of entity.

@bouwew, I’m happy with any feedback :wink:

Nice catch, the today_energy_kwh is definitely miscalculated. I have fixed it in the latest version 1.2.2.

I have assigned the “outlet” device_class according to this development page. Apparently the user documentation is kind of missing the switch entity.
Do you experience any negative behavior due to this device_class setting?

Thanks for the fix, the value is correct now.

Also, thanks for the link, I hadn’t looked there :slight_smile:
Indeed, the documentation is not great.

Just FYI, not to steal your thunder @brefa :slight_smile: , initial support for the Plugwise Stretch with firmware 3.1 is available in Plugwise-beta. Please leave a message in the Plugwise Smile custom_component (BETA) topic if you are interested in helping us test.

@brefa I just noticed that after the latest update the sensors for power_consumption_today_xyz and power_consumption_yesterday_xyz are always zero.