Broadlink SP3S Power consumption sensor

Hey,

My Broadlink SP3S have just arrived and it is working great so far. As I know it has power consumption meter, so there is little implementation of it to HASS. For energy consumption packet credit goes to GitHub user “eschava”.

Source code is here: https://github.com/algirdasc/homeassistant-backup/tree/master/custom_components/sensor

Configuration:

sensor:
– platform: broadlink_power
name: name of sensor
host: IP Address
mac: MAC Address

7 Likes

like this??

  – platform: broadlink_power
    name: COuch Light power
    host: 192.168.1.101
    mac: '02:0f:b5:dxxx'

Thx, unfortunately I could not get it work
I put the broadlink_power.py in .homeassistant/custom_cmponents/sensor and added

 – platform: broadlink_power
   name: "SP3"
   host: "10.0.0.105"
   mac: "34:EB:34:9D:A1:AA"

but i get

ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
...  in "/home/homeassistant/.homeassistant/sensor.yaml", line 20, column 7

which is this entry
Any ideas?
Update: Using only the switch works fine (which means that the connection works)

I got it working now
I removed the " _ " in the filename and changed the order of the entry in sensors.yaml.
But I think it was the “_”
Thx, for the code!

@algirdasc and the others

are you guys satisfied with the SP3S? Do all functions work with Home Assistant? Does it work reliable? At the moment I am deciding which power consumption meter I should buy.

Broadlink SP3S
Sonoff POW, flashed with Tasmota
TP-Link HS110

Somehow I am leaning towards the Sonoff with custom firmware, but I don’t like that I have to add 2 cables and I’ve read that even the replacement models are overheating.

@DanielXYZ2000, sorry for not replying. My account was suspended for unknown reasons. I’m glad that you resolved your problem by yourself.

@Walhalla, I have Broadlink SP3S and Sonoff POW. What I don’t like about Broadlink is that it uses 3rd party servers, also sometimes I get timeouts in HA logs, but it controls OK. What I like about Sonoff POW is custom firmware, which can be adapted to my needs. Also, I have other hardware, which runs Sonoff-Tasmota firmware, so I prefer unified software in my home cloud, altough I have no plans on changing Broadlink SP3S.

1 Like

@walhalla, I also like the custom firmware for the sonoff (pow), but the compact design of the SP3S is optically nicer and further the SP3S is quite cheap. (no connectors must be added to the sonoff pow)
What I don’t like at the SP3S is the initial configuration with the app and that it looks like that its calling home - that’s why I don’t let this device into the internet (firewall rule)
I did not try the HS110 because of the price (SP3S is very cheap at aliexpress)

1 Like

Hi !

Thanks for sharing !
I just received my power plug too, and tried to install it in HA, but i got :

Unable to install package broadlink==0.5: Could not find a version that satisfies the requirement pycrypto==1000000000.0.0 (from -c /usr/lib/python3.6/site-packages/homeassistant/package_constraints.txt (line 20)) (from versions: 2.0.1, 2.1.0, 2.2, 2.3, 2.4, 2.4.1, 2.5, 2.6, 2.6.1)
No matching distribution found for pycrypto==1000000000.0.0 (from -c /usr/lib/python3.6/site-packages/homeassistant/package_constraints.txt (line 20)) 

I’m not very comfortable with Python yet, so any idea ?

The switch works fine by the way :wink:

Have you tried updating your Home Assistant installation?

Yes! I’m on version 0.64.3.
I’ll try to install the missing lib manually…

I tried this :

from this thread :
https://community.home-assistant.io/t/broadlink-not-working-since-0-64/

And it works !

Thanks for your time !

2 Likes

yep, me too, I like that it plugs directly into the outlet in the wall and that you don’t have to solder anything. BTW: I got the TP-Link ones, because I was able to get them with a new customer voucher for 22,90 Euro. Was a nobrainer, because you get 3 years of warranty from TP-Link.

1 Like

Does anyone have this working with the SP2?

The sensor appears but it always shows the usage as 0.01 W.

  - platform: broadlink_power
    host: 10.0.0.165
    mac: 'B4:43:0D:10:XX:XX'
    friendly_name: 'Computer'

Same here.
I get no errors from SP2 but the sensor always shows 0w.

Any chance to get it working?

I’m sorry, but I do not own SP2, so I cannot say for sure.

Thx anyway!

I’ve the SP3s but the same problem. It shows always 0.01 W

PS
just updated to 0.67 and now give some error:
2018-04-14 17:50:13 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 165, in setup_platform
switches = [BroadlinkSP2Switch(friendly_name, broadlink_device)]
File “/usr/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 260, in init
super().init(friendly_name, device, None, None)
TypeError: init() missing 1 required positional argument: ‘command_off’

https://github.com/home-assistant/home-assistant/issues/13864

Hi.
I am on 67.1 and still get errors:
[homeassistant.util.package] Unable to install package broadlink==0.5: Could not find a version that satisfies the requirement pycrypto==1000000000.0.0 (from -c /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/package_constraints.txt (line 18)) (from versions: 2.0.1, 2.1.0, 2.2, 2.3, 2.4, 2.4.1, 2.5, 2.6, 2.6.1)
No matching distribution found for pycrypto==1000000000.0.0 (from -c /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/package_constraints.txt (line 18))
2018-04-23 12:04:39 ERROR (MainThread) [homeassistant.requirements] Not initializing sensor.broadlink_power because could not install requirement broadlink==0.5
2018-04-23 12:04:39 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform sensor.broadlink_power: Could not install all requirements.

Even altering the broadlink==0.5 to become broadlink==0.5.1 hasn’t solved.

Read for file location to install
https://github.com/home-assistant/home-assistant/issues/13998

File to copy and replace init.py is
https://github.com/mjg59/python-broadlink/blob/master/broadlink/init.py

After change my mp1 show correctly on frontend.