Kitz Forum

Computers & Hardware => Other Technologies & Hardware => Topic started by: Ixel on October 24, 2021, 09:57:11 PM

Title: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on October 24, 2021, 09:57:11 PM
I'm looking into getting a smart plug for my home lab but need something I can be sure works with the Home Assistant software (not to be confused with Google Home Assistant).

I looked into TP-Link but apparently they've recently made it so in future things like Home Assistant won't work with their smart plugs (changes in firmware in relation to security). I was wondering if anyone knows of any brands and models which are compatible and can be controlled by Home Assistant (e.g. power on or off). One use case I have in mind is to shutdown all equipment in the room if there's an extremely abnormal room temperature. Recently my portable air conditioning unit developed a fault which ended up making it produce heat instead of cool air, subsequently the room and upstairs (as the door was open) became quite warm after a while. While everything coped with ambient temperatures of around 30C or higher for a few hours, I'd rather have a failsafe system in place.

At the moment I've done something so that if the room temperature exceeds 27C then I will receive a push notification about it. If the room temperature continues to rise and subsequently exceeds 30C then the server will gracefully shutdown, as long as there's no issues with that process. However, all other equipment in the cabinet remains powered up.

I've looked at a PDU which can be controlled remotely, however they seem pricey - not to mention they generally seem to have kettle lead connectors while I'm looking for the usual 3-pin UK plug (BS 1363 if I'm not mistaken) connector.

Screenshot from Home Assistant of my temperature sensor, powered by Philips Hue motion sensor (they also report the temperature):
(https://i.imgur.com/Y3qzfu4.png)
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: meritez on October 24, 2021, 11:42:54 PM
I use Tapo P100s and L530s, home assistant seems to still work with them:

https://community.home-assistant.io/t/custom-component-tapo-p100-plug-control/240734/243

Where did you read that tplink are changing the security?
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Alex Atkin UK on October 25, 2021, 01:20:17 AM
I love the "were making it more secure by FORCING you to hand us all your personal details an allow us to withdraw the service at any time" that a lot of companies are doing.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Weaver on October 25, 2021, 06:28:12 AM
Are there devices that work on an isolated LAN, ie one with no internet connection? I wouldn’t allow a ‘phone-home’ device to be talking to some random server from my own network, due to extreme paranoia.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on October 25, 2021, 10:37:18 AM
I use Tapo P100s and L530s, home assistant seems to still work with them:

https://community.home-assistant.io/t/custom-component-tapo-p100-plug-control/240734/243

Where did you read that tplink are changing the security?

https://alerts.home-assistant.io/#tplink.markdown

Sadly TP-Link isn't an option unless I'm fairly certain the plugs I receive will have older firmware that allows access from Home Assistant.

Are there devices that work on an isolated LAN, ie one with no internet connection? I wouldn’t allow a ‘phone-home’ device to be talking to some random server from my own network, due to extreme paranoia.

Good question, although alternatively it's probably possible to just add firewall rules to drop all internet access for the smart plug(s) if they aren't dependant on internet access to connect with their manufacturer's server(s).
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: meritez on October 25, 2021, 11:11:09 AM
https://alerts.home-assistant.io/#tplink.markdown

Sadly TP-Link isn't an option unless I'm fairly certain the plugs I receive will have older firmware that allows access from Home Assistant.

Good question, although alternatively it's probably possible to just add firewall rules to drop all internet access for the smart plug(s) if they aren't dependant on internet access to connect with their manufacturer's server(s).

Thank you, that's the KASA brand, not the TAPO brand.
KASA was always a bit iffy, it supports IFTTT, but TAPO does not.

No-one is sure why TP-LINK offers two different brands of Smart Device, but it's coming clearer
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on October 25, 2021, 12:06:29 PM
Thank you, that's the KASA brand, not the TAPO brand.
KASA was always a bit iffy, it supports IFTTT, but TAPO does not.

No-one is sure why TP-LINK offers two different brands of Smart Device, but it's coming clearer

Ah I see, well spotted, I didn't realise they were different. Yeah it confused me. In that case I will go with the TAPO. Thanks!
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Alex Atkin UK on October 25, 2021, 02:35:06 PM
Are there devices that work on an isolated LAN, ie one with no internet connection? I wouldn’t allow a ‘phone-home’ device to be talking to some random server from my own network, due to extreme paranoia.

There are open source projects I believe to build your own devices as well as software.  Its possible some units can maybe be flashed with open source versions of the firmware as they're likely based on it to begin with?  I know my LED light strip controllers are supposed to be but I've never gotten around to figuring it out.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: meritez on October 25, 2021, 03:41:59 PM
Are there devices that work on an isolated LAN, ie one with no internet connection? I wouldn’t allow a ‘phone-home’ device to be talking to some random server from my own network, due to extreme paranoia.

There's Tasmota:https://tasmota.github.io/docs/
Identifying chipsets is not fun though, home assistant via hass.io does give you the flexibility to not have smart devices calling home.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Weaver on October 26, 2021, 06:20:48 AM
Good question, although alternatively it's probably possible to just add firewall rules to drop all internet access for the smart plug(s) if they aren't dependant on internet access to connect with their manufacturer's server(s).

Ixel makes a good point. I had thought about that, but wondered if some devices would simply fail.

An issue occurs to me though. I can’t identify the devices in question by IPv6 addresses necessarily, if they support IPv6. I could firewall them by MAC address though as the Fb2900 has that feature, and possibly my WAPs can do something similar too, not sure. It’s unmaintainable though, not that that has stopped me in the past.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on November 04, 2021, 12:50:35 PM
To follow up on this thread, I was also looking at the possibility of controlling my portable air conditioner's fan (as it runs continuously) when the room was below a certain temperature.

For example:
- Switch it off when the temperature is below 20C for at least 2 minutes
- Switch it on when the temperature is above 21C for at least 2 minutes
- Air conditioner temperature is set to 23C so compressor comes on if the temperature rises around that, it will automatically restore previously used settings in the event of a power failure

Unfortunately a majority of the smart plugs out there don't appear to have the capability of handling a 'motor load' of more than 2-3 amps at best, which is insufficient. The air conditioner also doesn't support a remote control, so an IR blaster wasn't an option either.

Solution? Well today I'm going to try something called a SwitchBot Button Presser. Home Assistant apparently supports this integration so fingers crossed I can have an automation instruct the SwitchBot device to press the 'power on/off' button on the air conditioning unit depending on the room temperature conditions mentioned above. I didn't even realise such a device existed until I came across it on Google by accident. I was previously considering making some kind of Raspberry Pi gadget to press the button, but this device should save me that bother.

SwitchBot Button Presser: https://www.switch-bot.com/products/switchbot-bot

I'll edit the post again later with the outcome.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: tiffy on November 04, 2021, 02:22:28 PM
Check out "Shelly" devices, have recently bought a few to have a play with in connection with home automation, very reasonably priced and have a very good reputation for reliability.
The basic Shelly-1 relay has a 16 amp relay so in theory can support up to 3Kw. load control, however, think if I was controlling that type of load I would prefer using an external interposing relay/contactor as the units are so small.
All the range are fully Tasmoto FW "flashable", have tried this on one unit but decided that the latest native Shelly FW was better now being full MQTT compatable and re-flashed back to native FW.

The range also supports full integration with Home Assistant.
Excellent web site and forum, lots of information and support.

Currently configuring the Shell-EM power monitor on a RPi-3B-Plus broker with node-RED, Mosquitto, Influx and Grafana SW, houres of fun.

I placed my first Shelly order with Amazon (prime) and it took close to a week to deliver, appeared to come directly from the Bulgarian factory.
Second order placed via the Shelly UK shop, modest Royal Mail P&P charge, arrived next day, better option, appear to hold their own stock.   
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: j0hn on November 04, 2021, 04:58:12 PM
Every smart plug I own handles considerably more than 2-3amps.
I run a kettle from 1 and a portable air con/heater on another with zero issues.

Most of my smart plugs are rated around 1500-2000w and 13a.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on November 04, 2021, 08:46:39 PM
An update to mention the SwitchBot is working on my Home Assistant, although I ended up using SwitchBot's API to achieve this as I couldn't get the integration working (config flow error, couldn't find the cause).

Check out "Shelly" devices, have recently bought a few to have a play with in connection with home automation, very reasonably priced and have a very good reputation for reliability.

Interesting, will check them out, thanks.

Every smart plug I own handles considerably more than 2-3amps.
I run a kettle from 1 and a portable air con/heater on another with zero issues.

Most of my smart plugs are rated around 1500-2000w and 13a.

Yes, the Tapo P100's are rated 13A, but only the little manual leaflet that comes with it says that there's a limit of 2A 'motor load' (which I assume would mean the compressor in my air conditioning unit for example)?
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: burakkucat on November 04, 2021, 08:53:22 PM
Yes, the Tapo P100's are rated 13A, but only the little manual leaflet that comes with it says that there's a limit of 2A 'motor load' (which I assume would mean the compressor in my air conditioning unit for example)?

An inductive load, such as a motor, will momentarily draw a high current at switch-on.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: tiffy on November 04, 2021, 09:07:10 PM
Quote
An inductive load, such as a motor, will momentarily draw a high current at switch-on.

Yes, the general "rule of thumb" for industrial 3 phase induction motors is transient startup current approx. 6 times FLC as far as I remember, not sure if this ratio would directly transpose to a domestic single phase motor but certainly a factor to consider.

Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on November 05, 2021, 10:59:29 AM
From what I would gather then it's definitely not suitable to run my portable air conditioner through one of these Tapo plugs :D.

The SwitchBot button presser gadget so far is working fine. The one thing that concerns me is what happens in the event their API goes down temporarily. I might need to consider making a small bash script or something to check the response from cURL to make sure the command to press the button was successful and if it was successful then toggle the 'input boolean sensor' state in Home Assistant (e.g. the supposed power status of the portable air conditioner for Home Assistant to go by - on or off).

I've so far done some logic for where the mains power might be off (e.g. power cut), don't try to press the button if so. Same also for if the internet connection appears to be down or the Hub is for some reason unavailable.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: tubaman on November 05, 2021, 11:35:31 AM
I have plug-in timers that are similarly rated at only 2A inductive load despite being 13A resistive and I believe this is quite usual for relay switched devices. The Shelly-1 device mentioned by @tiffy appears to be relay controlled too but does not mention an inductive load capacity in its spec. It does however mention 'resistive load' on its CE conformity document - https://shelly.cloud/documents/certificates/Shelly_1_CE.pdf
 :)
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: tiffy on November 06, 2021, 12:26:10 PM
Quote
The Shelly-1 device mentioned by @tiffy appears to be relay controlled too but does not mention an inductive load capacity in its spec. It does however mention 'resistive load' on its CE conformity document

I only use the Shelly-1 relay for lighting and small non inductive load applications for which they are ideal due to their very small size profile, can fit directly into some switch and ceiling light enclosures, even have a model available (Shelly-1L) which does not require an available neutral, normal situation at UK lighting switches.

As previously stated, would only ever contemplate using the Shelly-1 relay to control an inductive load such as a motor via a suitably rated external relay/contactor.
Title: Re: Smart plugs and Home Assistant (hass.io) - What to buy?
Post by: Ixel on November 06, 2021, 09:23:22 PM
Thanks, I'll keep it in mind.

Unless I encounter some trouble with the current setup then I'll keep things as they are. So far I've had no problems with it, the 'bot' presses the button when it's asked to. :fingers: