Plugwise core and custom_component

Thanks I’ll have a look. Before the core version was indeed too far behind. Still an option to disable the messages (or at least not make them persistent notifications) would be nice for the future.

I can’t seem to connect a normal Circle to a Circle+ either. I tried to reset them. The should automatically join, right? Also trying it in the Source software doesn’t work. Any tips?

Probably the reset was not successful. Yes, when a reset is done correctly, it should automatically join.

Please google for the Circle reset options, if I remember correctly, there were 3 different methods, depending on the age/firmware of the Circle.

Hi,
Sorry for this newbie question. Just moving from Homeseer to HA.
Started with this plugin and it worked fine. After a couple of days it stopped suddenly.
Only installed Samba Backup around the same time. Stopping this integration didn’t help. What’s the best way to investigate the reason of this failure?
Running HA in a Virtualbox on a NUC (Windows). Pls let me know if there’s a better location tot post this question on the community.

Deze fout is ontstaan door een aangepaste integratie.
Logger: homeassistant.config_entries
Source: custom_components/plugwise/usb.py:102
Integration: Plugwise Beta (documentation)
First occurred: 09:25:56 (2 occurrences)
Last logged: 09:26:17

Error setting up entry Stick for plugwise
Traceback (most recent call last):

  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/plugwise/__init__.py", line 18, in async_setup_entry
    return await async_setup_entry_usb(hass, entry)
  File "/config/custom_components/plugwise/usb.py", line 102, in async_setup_entry_usb
    await hass.async_add_executor_job(api_stick.connect)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/plugwise/stick.py", line 172, in connect
    if self.msg_controller.connect_to_stick(callback):
  File "/usr/local/lib/python3.10/site-packages/plugwise/controller.py", line 101, in connect_to_stick
    if self.connection.connect():
  File "/usr/local/lib/python3.10/site-packages/plugwise/connections/__init__.py", line 36, in connect
    self._open_connection()
  File "/usr/local/lib/python3.10/site-packages/plugwise/connections/serial.py", line 29, in _open_connection
    self._serial = serial.Serial(
  File "/usr/local/lib/python3.10/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/local/lib/python3.10/site-packages/serial/serialposix.py", line 336, in open
    self._update_dtr_state()
  File "/usr/local/lib/python3.10/site-packages/serial/serialposix.py", line 713, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)
OSError: [Errno 5] I/O error

I have a Plugwise on/off wall switch/button that controls a couple of circles turning some lights on and off. This was set up with the original Plugwise software.

  • It seems when turning circles on/off using this switch, controlling the circles directly, the on/off status of the circles does not seem to update in HA.

  • I’ve searched for how to add these wall switches to plugwise beta to see if this could help but couldn’t find info.

@herbus I would suggest removing the integration, restart HA and add the integration again. Maybe that will help.

I myself have no idea why this happens, maybe @brefra, do you have an idea?

@MagnusT you mean you have this Plugwise device: Plugwise | Switch | We ❤️ Smart! | ROBBshop ?

@brefra does the present released Stick-code support this device?

Yes, looks right :slightly_smiling_face::+1:

@herbus, This looks like the USB stick is not responding at all. If the suggestion of Bouwe doesn’t help, try to disconnect and reconnect the stick itself.

@MagnusT, The support for the switch devices is experimental. I don’t own any switch device so I’m not able to test. Anyway I know there is currently no support to intercept switch requests to update the relay state of an “attached/configured” circle device. Be aware at least once an hour the relay state is retrieved from the circles, so eventually they should update and reflect the correct state.
I just noticed the beta custom_component doesn’t show the switch devices yet. Let me check if it’s easy to expose switch devices as binary sensor button in HA. Unfortunately a button takes a bit more work to add

Thanks for the reply. Great info that they do update once an hour.

The wall switches aren’t really a problem at all, I’m extremely happy that this exists for HA as is :+1::pray:

Hi all, I’m a happy plugwise source (Windows) user and slowly moving to HA.
I use it mainly to monitor power (Kwh) like for solar panels.

So I installed Plugwise beta through HACS
First I noticed that the energy reading using the stick is not very good
See first screenshot

So I moved to a stretch 2.0 and this improved that a lot
See second screenshot

Now that covers the energy (watt) bit but I want power readings

This line should be linear but it’s far from that
I guess there is no easy way to fix this
See last screenshot

Now how do I get a proper Kwh reading ?
I tried and failed with the utility meter
Is this something to be done with the Riemann sum integration and if yes, how ?

This question has been asked before :slight_smile:
Please see this post:

@brefra @bouwew thanks for the suggestions. I’ve found the cause. For some strange reason HA didn’t see the Plugwise stick anymore. The Stick is plugged into a Raspberry pi. I use VirtualHere to connect the USB devices that are connected with this pi (to have a more central place in the home) with the NUC. There are 3 devices connected via a USB hub to this pi: the Plugwise stick, RFXcom and a P1 cable. Changing the stick directly into the pi solved the issue. It seems that there was a addressing conflift on the USB hub.
Thanks again for your suggestions.

Started to migrate from Domoticz to Home Assistant recently and was pleasantly surprised that there was already an integration for my Plugwise Circles. My initial setup was with the USB stick directly connected to my HASS and using the plugwise_beta integration. Initial discovery of the Circles looked promising however after some time started experiencing issue’s (Circle’s not responding & KwH used counters not increasing). Tried to remove/add integration couple of times with different results but never ending up in a stable situation (Note that if I connect the USB stick to my Windows PC running Source all circle’s seem to be logging normally and respond well and reliably so network seems to be stable).

Because of the issues decided to buy a secondhand Stretch (version 2.0.16 including an extra Circle+) and setup an additional test network with some Circles. Response seems to be a lot more stable for the modules connected through the Stretch. However there I don’t completely understand the “_electricity_consumed_interval” entity. If I look on the stretch XML values it seems to be a counter that represents the consumed energy for the last hour however in HA it looks like it’s adding this value every x minutes and adding it to the previous value so instead for example the device is reporting 230Wh consumed per hour instead of the 18Wh what is actually consumed. Tried playing with a “Helper” entity like suggested in previous posts but cannot get that to work. Also it looks like the integration with the USB stick seems to be able to gather a lot more statistics.

Any suggestions what would be the best way forward and at least get my hourly/daily consumption figures correctly into Home Assistant/ the energy dashoard?

Thanks in advance for your suggestions

What is the firmware version of your Stretch? V2.0.16?
If it is, that’s a pretty old one, the oldest we know of is v2.3.x.

I know that @brefa is working on a huge update for the Stick integration, I think that this integration is the best way forward for your case in the future.

Regarding your problem with the Stretch, can you post some pictures to explain the problem more clearly? With some extra information I might be able to see if there’s a bug in the code.

1 Like

@debink, I might have an idea what is causing this.
The State_Class of this sensor is wrong. Are you able and willing to test a pre-release version of plugwise-beta?


@bouwew Yes version I have running is 2.0.16. Already gave me some headaches trying to upgrade it as when I bought it was on 1.0.34 :slight_smile: but can give a try to upgrade to 2.3. The picture attached is showing the consumption. But this is with a continues load of only 18watts so would expect the consumption to be around 18wh (per hour). Sure I’d be willing to test a pre-release if you can give me some pointers on how to install it (still learning HA).

Thanks! Yes, the graph is clearly wrong. I think I have found the reason but the result after the update is still not what it should be, I think.

How have you installed Plugwise-beta? Via HACS?

Yes tried both with version v0.30 and “main”.

In HACS, in the Plugwise page you can press 3 vertical dots, in the top-right corner. Then press Redownload and activate the Show Beta switch. This will show the pre-releases.
Please redownload/install v0.31.0a3, this version contains a fix that might solve your problem.