Author Topic: Smart Plugs  (Read 13162 times)

Tim Hall

  • Victoria is my queen
Re: Smart Plugs
« Reply #50 on: 10 May, 2021, 11:29:30 pm »
Resurrecting this thread because I have recently discovered Tasmota.  Open source firmware for myriad internet-of-shit devices that can make them a lot less shitty (speaking MQTT/HTTP locally, without any of that cloud nonsense).
Does the Bold bit mean Jeff Bezos/Sundar Pichai don't get to know when you're turning your kitchen light on? It's all within the Kim & barakta Towers Netjbex?
There are two ways you can get exercise out of a bicycle: you can
"overhaul" it, or you can ride it.  (Jerome K Jerome)

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #51 on: 10 May, 2021, 11:41:59 pm »
Resurrecting this thread because I have recently discovered Tasmota.  Open source firmware for myriad internet-of-shit devices that can make them a lot less shitty (speaking MQTT/HTTP locally, without any of that cloud nonsense).
Does the Bold bit mean Jeff Bezos/Sundar Pichai don't get to know when you're turning your kitchen light on? It's all within the Kim & barakta Towers Netjbex?

Exactly.  Needless to say I've got all this stuff quarantined on its own VLAN with no access to the outside internet.

To do clever thigns with Tasmota you need a MQTT broker (a simple piece of software that stores and forwards messages between clients).  Sort of thing that's easily run on a Linux server, Raspberry Pi or virtual machine.  And probably some sort of high-level decision-making/user interface stuff.  Don't ask me about that bit, I've just grafted them into my own proprietary system, but I see talk about NodeRed in Tasmota circles.

But, TBH, Tasmota has a lot of useful functionality on its own: Clever timers, event-based rules, sensor thresholds, that sort of thing.  So if you want, say, a light that comes on for 5 minutes when you press the switch and then switches itself off, but only after sunset, you can do that without connecting it to anything[1].  And the HTTP interface is phone-friendly (accessing and resolving it left as an exercise for the reader).  Not that these smart things won't have similar functionality on their stock firmware, but it probably relies on some cloud service at some point.


[1] Well, a time server's probably helpful...

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #52 on: 15 May, 2021, 12:30:17 am »
Today's adventure in wanky automation was configuring CUPS to tell the smart plug feeding the laserjet to switch on when a job is added to the print queueue.

This is obviously a vast improvement on the previous system of messaging barakta on IRC to tell her to frob the switch...

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #53 on: 29 September, 2021, 09:18:16 pm »
I've discovered another exciting use for smart plugs:

I fitted one to the microwave so that, like the kettle, the alerting system could provide a visual cue that it had finished (so barakta doesn't unknowingly leave it beeping).  It occurred to me that I could program it to power-cycle at exactly 13:01[1] every day, thereby bodge-synchronising its spectacularly inaccurate clock.   :thumbsup:


[1] For reasons that don't really make sense, the clock is 12-hour and starts from 1:01 at power on.

Re: Smart Plugs
« Reply #54 on: 30 September, 2021, 01:19:59 pm »
Today's adventure in wanky automation was configuring CUPS to tell the smart plug feeding the laserjet to switch on when a job is added to the print queueue.

This is obviously a vast improvement on the previous system of messaging barakta on IRC to tell her to frob the switch...

Ooh I like that one. How much delay did you have to build in before the print job gets sent to allow the printer to boot and dhcp etc? Or does CUPs just keep retrying until the printer comes online?
I think you'll find it's a bit more complicated than that.

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #55 on: 30 September, 2021, 02:05:58 pm »
Today's adventure in wanky automation was configuring CUPS to tell the smart plug feeding the laserjet to switch on when a job is added to the print queueue.

This is obviously a vast improvement on the previous system of messaging barakta on IRC to tell her to frob the switch...

Ooh I like that one. How much delay did you have to build in before the print job gets sent to allow the printer to boot and dhcp etc? Or does CUPs just keep retrying until the printer comes online?

No delay, I think it just retries for a bit.

tea4CUPS and curl are the special sauce.

SoreTween

  • Most of me survived the Pennine Bridleway.
Re: Smart Plugs
« Reply #56 on: 21 December, 2021, 09:15:02 am »
Warning, very long and picture heavy nerd posts follow.

Soretween's first adventures with Tasmota:

After Kim posted about Tasmotizing a Blitzwolf SHP-11 I ordered a pair.  They sat on the pile of things to be fiddled with until last week as I wanted to monitor the power on our freezer as a) I was sure it was using a lot of power and b) it was about to be replaced.  Following Kim's guide it was dead easy.  I only managed to get the old freezer on it for one full 24 hour period during which time it used 0.743 kWh, the replacement is twice the size and used 0.433kWh it it's first full day of run time.  Neat.

But back up a moment.  It wasn't only the freezer situation that made me extract digit regarding the Blitzwolf, It was also because when I got home from work at the end of November Mrs Tween asked me to help setting up some smart sockets. She wants to be able to control multiple lights together instead of turning each on/off individually.  These are the beasties she'd bought:

Those are Meross MSS210 smart sockets. And here's one with a Blitzwolf:

Hmmm, cheap chinese copies?  Nah, couldn't be.  2 minutes looking at the crapola software on Mrs Tweens phone and 5 minutes trying to find online if they work direct (phone to gadget) or through somebody else's computer (I needed to know as they'd be on different VPNs depending) and I'd had enough, they'd be jailbroken or binned.

So that was the point at which I Tasmotaized a Blitzwolf to learn the process.  Next I spudgered my way into one Meross.  Exactly as expected I found what I initially thought was the same PCB with the power monitoring devices unpopulated (Blitzwolf on the right):

But flipping the PCB over It becomes obvious the ESP8266 riser is not exactly the same:

Actually, it's not an ESP8266 at all in the Meross:


Ah well - RTL8710 must be effectively the same thing mustn't it?  So supported by Tasmota - yes?  No.
Quote
Tuya Convert

Tuya devices are sold under numerous brand names but they're all identifiable by the fact that they connect with these phone apps: "Smart Life" or "Tuya Smart". They incorporate different types of Tuya Wi-Fi modules internally.
Tuya has begun manufacturing some Wi-Fi modules using a Realtek RTL8710BN Wi-Fi SOC instead of an ESP82xx chip.
Tasmota cannot run on Realtek devices and there are no plans on supporting them.
The RTL devices are cheaper and being Arm based lower power apparantly.

Bum. So I'm snookered?  Nah :-)
2023 targets: Survive. Maybe.
There is only one infinite resource in this universe; human stupidity.

SoreTween

  • Most of me survived the Pennine Bridleway.
Re: Smart Plugs
« Reply #57 on: 21 December, 2021, 09:35:34 am »
I happened to have some WeMos  D1 mini in stock:

That's an ESP 8266 module (the dark PCB) on a carrier board that provides a USB socket for programming (just visible at the bottom).  Far too big to fit in as is but if I can get the ESP off the carrier... Tasmota went straight on it with a default template and I checked it was visible on the network when powered from 5v from a bench psu.  Then began the difficult job of desoldering the ESP from the carrier.  And that did not go at all to plan.
First attempt I used too much force & ripped a load of pads off both the esp board and the ex-carrier (heat from a paint stripper gun).  I was too worried about overheating it.  2nd attempt went better, all the esp board pads were fine and I only damaged 3 pads off the carrier (no matter).  So I carefully connected it to my bench PSU to see if it had survived.  I don't actually know if it did because it sure as hell didn't survive me switching on the PSU still set to 5V the carrier needs instead of 3.3v the ESP needs. Bum.

New plan needed:  The back of the dead ESP boards were marked with ESP-12-F.  Since I need 4 and I'm down to 2 WeMos left I may as well cut out the hassle,  South American River Co provided 5 ESP-12F for £13.99 next day.  This is the pinout of the ESP-12F from the manual:

The pinout is not exactly the same as the WeMos carrier above.  GPIO15 (yellow wire) isn't a straight connection and EN on the ESP-12F isn't brought out to a pin on the carrier at all.  Since that pad was one of the 3 I'd ripped off the 2nd desoldering attempt I had to trace it back (Blue wire). 


At which point things got really frustrating, it just wouldn't work.  I checked and re-checked the documentation and my soldering and still Tasmotizer just wouldn't connect to program the little sod.  It turned out to be a combination of 2 problems.  Lead free solder (the work of Stan) on the carrier board giving me dry joints, in particular the blue wire to the resistor.  How can a mechanically sound joint made entirely of solder not conduct?  Grr.  2nd, it took a few resets to get Tasmotizer to connect.  With a D1 mini you just plug it in to USB & they wake in programming mode every time.  With the wires between the carrier & ESP12F it took a good few resets with Tasmotizer attempting connection to get it to work.
Once programmed I powered the carrier from the bench psu to confirm it was working & desoldered it from the spiders web.  Then I could start figuring out how to connect it to the Meross.  These are the connections viewed on the underside of the Meross PCB:
Code: [Select]
     Relay |
            |
HWLBL SELi |
            |
           |
            | LED
  Button 1 |
            | BL0937 CF
       GND |
            | HLWBL CFi
       VCC |
So the 12F needs connecting like this.  Connections in brackets are shown for completeness, I don't need them as this PCB doesn't have the power monitoring:
Code: [Select]
    GPIO15 |
            |
  (GPIO03) |
            |
           |
            | GPIO00
    GPIO13 |
            | (GPIO05)
       GND |
            | (GPIO14)
       VCC |
There's no connection for RST and EN.  Those are handled on the riser board, see the 3 little resistors down the bottom (Blitzwolf socket so this is an ESP riser)


So a certain amount of creative bodgery will be required:



And fitted:




And so remembering to adjust and then double check the voltage I ran it off the bench PSU and lo, it was visible on the network.  I blatted Kim's Blitzwolf Template onto it and soldered it back into the socket.  And blow me it works :-)
It is of course spouting garbage related to the power monitoring over mqtt but I'll get to that.  First I need to just rinse and repeat 3 more times.
2023 targets: Survive. Maybe.
There is only one infinite resource in this universe; human stupidity.

SoreTween

  • Most of me survived the Pennine Bridleway.
Re: Smart Plugs
« Reply #58 on: 21 December, 2021, 10:06:36 am »
Yeah, 'just' repeat 3 more times ::-)  That spiders web fought me every step of the way.  RST was a dry joint when I soldered the 2nd into the programming web, those wires are tinned with lead free.  The 3rd crapped out mid programming (blue light on) and never worked again.  The 4th was just dodgy, there was a bad connection there somewhere but I couldn't find it.  The 5th would not program at all.  Eventually I figured out the resistor I was soldering the blue wire to had cracked (failed open circuit) & replaced it with an external one.  After a good few frustrating hours over a few days I had 3 more ESP-12F programmed with the default template ready to fit.
If ever I need to do some more I will 3D print a pogo pin adapter:

I also Tasmotized the 2nd Blitzwolf and (stupidly, without testing it) refitted it to the socket.  Nuffink.  So I had to remove it again and reconnect to Tasmotizer.  Where it works fine.  Try as I might I cannot get it to work in run mode (powering the Blitzwolf PCB).  More frustration.

Fitting the 3 ESPs to the three remaining Meross was straight forward.  Then I just needed a template:
Code: [Select]
{"NAME":"Mehross MSS210","GPIO":[320,0,0,0,0,0,0,0,0,32,0,224,0,0],"FLAG":0,"BASE":18}
I still need to fix the 2nd Blitzwolf.  I'll have one more go at fixing the fitted ESP module and if that fails I'll put an ESP-12F into it instead.  I have a feeling though the 3 extra connections and the non-staggered PCB pads will make that difficult.
2023 targets: Survive. Maybe.
There is only one infinite resource in this universe; human stupidity.

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #59 on: 21 December, 2021, 12:17:47 pm »
Nice bodging.  I replaced the ESP module in an old 'open source' smart bulb that never worked properly, which made it behave.  I think sometimes you do just get dodgy modules.  I've got a D1 Mini that's weirdly fussy about what WiFi networks it will connect to, using firmware that works fine on other modules.


New favourite smart plug: https://templates.blakadder.com/athom_PG04-UK16A.html

ETA: Unsuitable for heavy loads.  See below.

Functionally equivalent to the Blitzwolf, but pre-flashed with Tasmota, so no mucking about to get access to the serial pins, calibrating the power monitoring, etc.  Button on the top rather than the side, which is more convenient in most socket scenarios.  Only the single (blue) blinkenlight though.  Overall slightly smaller.

(I was shocked to discover a proper Bussmann BS1363 fuse inside.)

Other Athom products with Tasmota pre-flashed are available.  I've got a couple of their smart bulbs.  The warm-white's a bit meh, but (after installing a custom Tasmota build that allows PWM at 20kHz for barakta-compliance) it's fine for the stairs.

SoreTween

  • Most of me survived the Pennine Bridleway.
Re: Smart Plugs
« Reply #60 on: 21 December, 2021, 01:53:59 pm »
Thanks.  Calibration is still to be done, those power readings above should be treated as comparative rather than reliable.

Tasmota Device Groups are really jolly neat, getting the 4 Meross to turn on and off together was ridiculously simple.
2023 targets: Survive. Maybe.
There is only one infinite resource in this universe; human stupidity.

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #61 on: 03 March, 2022, 03:42:57 pm »
New favourite smart plug: https://templates.blakadder.com/athom_PG04-UK16A.html

Functionally equivalent to the Blitzwolf, but pre-flashed with Tasmota, so no mucking about to get access to the serial pins, calibrating the power monitoring, etc.  Button on the top rather than the side, which is more convenient in most socket scenarios.  Only the single (blue) blinkenlight though.  Overall slightly smaller.

(I was shocked to discover a proper Bussmann BS1363 fuse inside.)

Health warning: Whoever designed this overlooked that fuses get hot in use.  I've just discovered that the fuse cover of one that was controlling a fan heater (usually running at 1.5kW) has melted and disintegrated when poked.  On dismantling the unit, there is further melting of the plastic surrounding the fuse internally.

The rest of it seems decently engineered, so I'd suggest that these should be fitted with a 3A fuse and only used for light loads.


The Blitzwolf SHP-11 on the kettle seems okay.  (No fuse, so doesn't get as hot).  But those are now unobtanium.

I've just taken a punt on https://www.mylocalbytes.com/products/smart-plug-pm-uk as a potential replacement.

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #62 on: 24 March, 2022, 08:37:25 pm »
I've just taken a punt on https://www.mylocalbytes.com/products/smart-plug-pm-uk as a potential replacement.

Update: After powering a couple of fan heaters with them for a couple of weeks, these show no signs of melting.  I cracked one open (glue warning) and didn't see any obvious electrical horrors.  From the markings on the board, this appears to be a re-badged Sowye TP24 version C.

Only real complaint is the button on the side rather than the top, and that the blinkenlight is a bit bright.

FifeingEejit

  • Not Small
Re: Smart Plugs
« Reply #63 on: 24 March, 2022, 08:56:45 pm »
AS a slight Atethesis to the Smart part of this...

I'm looking for a radio controlled switch option, no timer, no app, no wank basically.
A mate had quite a nice looking one years ago but the closest I can find is this:
https://www.amazon.co.uk/DEWENWILS-Switch-Control-Wireless-Programmable/dp/B07YKFD952/ref=sxin_14_pa_sp_search_thematic_sspa

But as soon as you buy a multi-pack you lose the nice switch like remote control and get a remote control that looks like it should be opening a garage door
https://www.amazon.co.uk/DEWENWILS-Control-Wireless-Programmable-Sockets/dp/B07NJ2XHZC/ref=sxin_14_pa_sp_search_thematic_sspa


Really just want it to be able to turn the AV kit in the living room (3 sockets) and computer shit off at the wall without contorting myself in order to reach down, under and round what they live on
any thoughts?

Re: Smart Plugs
« Reply #64 on: 24 March, 2022, 09:24:02 pm »
A short switched extension lead, either on top of the thing they live on, or next to it so that switch can be operated with a foot?

They also come with anti-surge which can be useful for protecting AV stuff (if recent/delicate) and computery stuff against, err, surges.
Quote from: tiermat
that's not science, it's semantics.

Re: Smart Plugs
« Reply #65 on: 24 March, 2022, 09:25:10 pm »
We're using these more for the vaguely normal-looking light switches and wireless switching:  https://www.quinetic.co.uk/

You can get straightforward switch-only receivers, or ones with the switch wireless receiver and WiFi gubbins also.  The latter allows you to both set times for on/off and just use the switch regardless of timer state.  I haven't got round to trying to bodge proper smart connectivity to them because I didn't need it.

There is a socket adapter rather than light receiver, though I've not used it.  Grid switch units can be fitted inside the matching grid housing to make a wall mounted multi-switch that looks similar to a normal light switch.  We have several of the square flat switches just sat on bedside tables - they look like a normal light switch that hasn't been mounted or wired up, but they work the main room light.

If I understand your use correctly then you can also "train" multiple outputs to run off one switch (or vice-versa)?  Though you could achieve that with a 4-way extension lead into one rc socket?

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #66 on: 24 March, 2022, 09:40:27 pm »
A short switched extension lead, either on top of the thing they live on, or next to it so that switch can be operated with a foot?

Would be my approach, unless you actually care about smart features.  You know where you are with a physical switch.


Nice switch inputs for smart things seem to be surprisingly hard to achieve, not helped by the BRITISH approach of not having live available at the switch position, and even then that's a screwdriver job.  While being able to control your lights or whatever from a smartphone is occasionally useful (especially when mobility-impaired or otherwise In Bed), you'd have to be a real fanboy to want to use that as the only method.  I suppose if you enjoy talking to Alexa, that's a bit more reasonable.

Most of our lighting is now to some extent smart, and most of the control is through a combination of rules based on motion sensors and time of day.  My aim is that you shouldn't need to reach for a switch/phone/computer, because the lighting should already be doing the right thing, unless you want to manually turn it up to bastard bright before hoovering or similar.

This is, I think, an unfashionably 70s approach to automation.

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #67 on: 24 March, 2022, 09:44:34 pm »
If I understand your use correctly then you can also "train" multiple outputs to run off one switch (or vice-versa)?  Though you could achieve that with a 4-way extension lead into one rc socket?

Oh, one potential gotcha with those basic RF remote sockets (not the WiFi kind) - the RF receivers generate interference locally, so they tend not to work properly if you position them too close to each other.

FifeingEejit

  • Not Small
Re: Smart Plugs
« Reply #68 on: 25 March, 2022, 01:32:38 pm »
The hidden nature of the actual switch is a win in my book.
The TV has 2x4 Gang extension leads plugged into a 2 gang socket, the sound system has 1.

Going round turning 3 sockets off with a switch sticking out into the floor, nah.

Re: Smart Plugs
« Reply #69 on: 29 March, 2022, 09:15:38 am »
I almost bought the Tapo plug but the amp loading is lower than the Kasa and as it's for a heater I thought I'd best go with the Kasa.

Just picked up first smart plug, a tapo (tp-link) P110 "Mini Smart Wi-Fi Socket Energy monitoring".  £13.50.  Max load 2990W, 13A.  Easy to set up, & currently it's monitoring fridge socket.  Seems to give a current consumption, 24hrs, month; with histogram displaying 24hr or monthly tots over time.  Not tried the voice Alexa/Google functions.
Cycle and recycle.   SS Wilson

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #70 on: 29 March, 2022, 11:56:51 am »
Those appear to be based on the RTL8720CF so you're probably stuck with the manufacturer's firmware.

Re: Smart Plugs
« Reply #71 on: 29 March, 2022, 12:38:32 pm »
Ok, thanks.  Why might that be an issue, if wanted better functionality?  Only really bought that one to try, & because it had energy monitoring, with good reviews, but also had heard of TP-Link (used to have a router).  Plug also has CE mark FWIW.
Cycle and recycle.   SS Wilson

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #72 on: 29 March, 2022, 12:49:05 pm »
The main reasons to avoid proprietary internet-of-things things are:

a) They'll only inter-operate with what the manufacturer cares about them inter-operating with, unless you happen to be lucky.  (Case in point, that thread of people trying to get them to work with Home Assistant[1].)
b) If they depend on some internet service run by the manufacturer (common), they'll lose functionality when that service disappears.


[1] A popular open source smart-thing control system that works without an internet connection.

Re: Smart Plugs
« Reply #73 on: 29 March, 2022, 01:01:31 pm »
Best 'recognised brand' option for home assistant?  Apparently the tp-link Kasa plugs (look identical) used to support Home Assistant, but now don't because api removed?  https://alerts.home-assistant.io/#tplink.markdown
Cycle and recycle.   SS Wilson

Kim

  • Timelord
    • Fediverse
Re: Smart Plugs
« Reply #74 on: 29 March, 2022, 01:17:26 pm »
Best 'recognised brand' option for home assistant?

Shelly are usually a good start, but they don't do a BS1363 smart plug.

(I don't know much about Home Assistant, other than it likes to speak to devices over MQTT.)


Quote
Apparently the tp-link Kasa plugs (look identical) used to support Home Assistant, but now don't, because api removed?  https://alerts.home-assistant.io/#tplink.markdown

That's exactly the sort of internet-of-shit problem you want to avoid.  One day everything works fine, then a manufacturer deprecates an API it just stops working.   >:(

The only ways to really hedge against this sort of thing is either to be fanatical about open source (where with a bit of work you should be able to keep obsolete stuff alive indefinitely), or to buy into the biggest-name brand and hope they're not going to be too evil.