• The forum software that supports hummy.tv will be upgraded to XenForo 2.3 on Wednesday the 20th of November 2024 starting at 7pm

    There will be some periods where the forum is unavailable, please bear with us. More details can be found in the upgrade thread.

Remote controllable mains switches

Commenting on an old thread as I've just come across it, but if you search Amazon for "Teckin Smart Plug" these are great. They're controllable via smartphone using either the SmartLife or the Teckin app (I'd recommend SmartLife as it's more versitile). Also, someone on GitHub has written bit of Python code to be able to control them (and smart bulbs if you have them) from your computer - search github for dev-est and tuya-tray (sorry, I can't post links yet!).
I've got a number of things on these where I need to be able to remotely turn them on or off. Totally reliable. I tried those energenie ones a couple of years ago - totally underwhelmed by them as they didn't report accurate status (eg they said they'd turned the device on when they hadn't). The Teckin ones are 100% reliable, I've found.
 
Yeah, it was on my to-do list to develop a WiFi-controlled mains outlet, but the market has overtaken it. I'm now thinking a drop-in replacement for the HDR-FOX PSU (to resurrect units with PSU faults) with a watchdog timer for cycling power.
 
Last edited:
I tried those energenie ones a couple of years ago - totally underwhelmed by them as they didn't report accurate status
Yes, I was forced into buying something at short notice a couple of years ago for a relative and my experience matches yours. At least they are controllable via API and the separate RF remote works well. Control via the hub less so. See post #20 for the review of the thing I bought for myself.
someone on GitHub has written bit of Python code to be able to control them (and smart bulbs if you have them) from your computer - search github for dev-est and tuya-tray
That sounds like it's worth a look then.
 
I've recently bought a set of four Gosund WiFi smart plugs on a Black Friday deal, just because I can. They are a lot smaller than the TP-Link ones that appeared on The Gadget Show last week (and were a lot cheaper!). My main impulse was to replace the three mechanical timers running my xmas lights (powered from three locations around the house) - I've beefed up my public display this year because of the situation and as I have the time, but it's still fairly discrete. The timers were far from simultaneous, so I thought smart plugs would be a solution.

I'm pretty impressed, they installed easily and the app works in iOS and Android (but as usual the iOS app assumes you won't want to hold your tablet in landscape - I hate it when they do that, and why can't iOS itself enforce screen rotation on the app?). The app works on the smart plugs even across the Internet, so there could be a security issue (as if I'm worried about somebody hacking my smart plugs!). Another annoyance of the app is that there is no option to rearrange the control panel for the plugs - they are listed in reverse order of setting up.

Plugs can be grouped and turned on or off as a group, or operated individually (even when in a group). There is also a button on the plug itself to turn it on or off manually. Each plug also reports back voltage, current, and power in real time.

Timer operations can be set up for each plug, I don't know how many schedules can be set up. If anything, this is the bit that is annoyingly fiddly, and it was a pain putting the same schedule into the three plugs for my lights. Once programmed though, they appear to operate autonomously (and still with app or manual switching as well). The downside is they still come on and off with a spread of up to half a minute.

I have just discovered the "group" function can also be programmed for timer functions - that would have saved me putting in the same settings three times. The plugs are now synchronised so I conclude they are being orchestrated from a server instead of operating autonomously.

Each plug has a "countdown" mode too, which I assume means something like "turn [on|off] in x minutes and y seconds" - I haven't tried it.

There is something else in the app called "Tap-to-Run Automation", "Control multiple devices with one tap or by using an AI-enabled speaker through voice commands". Not tried this out yet. The product listing says it works with Alexa and Google Assistant, but doesn't mention IFTTT. There is a similar cheaper (rip-off?) product on Amazon which also claims IFTTT.

What is clear is that one of these can be used to reboot a crashed HDR-FOX - even from away from home. If we could hack the API, we might even be able to make two HDR-FOXes monitor and reboot each other.
 
Last edited:
....just discovered the "group" function can also be programmed for timer functions - that would have saved me putting in the same settings three times. The plugs are now synchronised so I conclude they are being orchestrated from a server instead of operating autonomously.
Yes, they're probably controlled by a cloud server(s). I wonder how much autonomy each plug has. Eg I'll expect them to perform the next scheduled function even if they lose internet connection, but I wonder what'll happen if they lose connection for half a day?
They may have similar firmware to earlier Teckin models. Eg use Tuya-Convert (with care, after lots of research) to free yourself from the server controlled software, but won't have the convenience that software allows etc.
Eg may be something like this https://www.malachisoord.com/2020/05/23/flashing-custom-firmware-with-tuya-convert/
 
Last edited:
That's interesting, because the cheaper non-branded version available I mentioned above referred to the Tuya app in the blurb.
 
I have just discovered IFTTT functionality within the settings in the app.
I have always found ifttt unreliable. If I rely on it to switch something, I often find it hasn't happened.

I really liked the idea of ifttt when it first appeared, but it has never evolved to remember its state. Nor is it, or was it last time I looked, capable of

If Scrat is away and Mrs Scrat is away then turn heating off
 
Last edited by a moderator:
I have always found ifttt unreliable. If I rely on it to switch something, I often find it hasn't happened.
Having discovered the hoops you have to jump through, and then that the catalogue of possibilities don't seem to coincide with anything I might want to do, plus the damn thing kept pestering me to pay for an account upgrade, put me right off. It seems to me people who use this stuff have too little else in their lives.

However, the worst thing about it was that, having set up a test IFTTT: a) it didn't work; and b) it overrode the locally set timer functions.
 
Good idea, but until the box is rebooted...

I really must get around to implementing my nightly timered brief power cut (within a power-off schedule), but mechanical timeswitches can drift (especially if there is a real power cut). Maybe Gosunds...
I'm looking into this now, but rather than a nightly power-off, which may introduce more electronic stress than needed, I would like to detect a crash and power cycle using linux on my wrt router and a linux-friendly smart plug. Of course a method without extra hardware would be for it to email me when a crash is detected, so that I can manually power cycle, but what started me down this route was suffering crashes while away on holiday. The first time RS told me the humax has stopped responding halfway through a holiday, I wrongly concluded I'd been burgled!

I've tried experimenting with cron jobs inside the humax to monitor system processes and cannot find a way of it detecting when it has crashed or predicting when it is getting unstable and on its way towards a crash - it's always very sudden, not a gradual memory leak etc. So detection must be external I think.

One option every morning is to try ssh'ing into the humax at the time it wakes up every day to run "disable OTA". If ssh fails, then a power cycle is needed.

Another is to detect a period during the day when it does not respond to ssh for 10 minutes or so (crashed) after having responded to ssh previously (turned on). This is on the basis that I only ever reboot it during the day, I never simply turn it off until it shuts down automatically at night.
 
Last edited:
Is there any way to detect a power-off being inititated from the remote control? Any pre-shutdown script that is run? I know the webif reboot can be detected, but not the remote control.

The main flaw in my remote monitoring plan is that if the humax wakes itself to record then shuts down, I would detect this as a crash. Is there any way of detecting after an ssh to the humax that the box woke up itself to record, or if not, simply that it is recording?
 
Last edited:
The main flaw in my remote monitoring plan is that if the humax wakes itself to record then shuts down, I would detect this as a crash. Is there any way of detecting after an ssh to the humax that the box woke up itself to record, or if not, simply that it is recording?
My suggestion is not to let it turn off. If you have a cron running to (say) ping a particular IP address every (say) 60 seconds, and the pings stop coming, you know it's crashed.

The problem with this is it's entirely possible for settop to crash while leaving the rest of the system intact, including the cron process. Consequently there seems little choice than the nightly brief reboot.
 
I use ping and http connection monitoring, but you could use ssh instead, and I'm just using it to trigger SMS notifications. I find that ping sometimes still works when everything else has stopped working.
Obviously you cannot use crash detection on the thing you are trying to monitor.
I ported mosquitto, which you could use to push periodic status messages out to something, but nobody seemed interested in making it an official package.
 
Back
Top