Device to trigger flows based on power level threshold?

I'm not sure I follow. How are you detecting the wattage usage change? Or are you using another means of detecting a toggle switch position?

I was replying to this ā€œcloudā€ part of the discussion not the edge device for current detection. I donā€™t use those frameworks and I can be totally portable with a network not even connected to the cloud.

Ah. Yeah. I would prefer to not have to go outside my network for the currant outlet. What the support guy told me is that they have a local network mechanism (at least for the notifications to my phone, which appears to be failing), but unless I reverse engineer that communication, those external integrations are the only way to get into node red.

I'd prefer to have a solution that doesn't involve getting into the wiring or adding another system, but I may need to break down and add something like a 433 or z-wave hub. And if I do that, I'm going to need to get another Pi. Mine's overloaded as it is.

Not sure what country you are in - but does not really matter - as these devices are ubiqituous - In Australia (e.g.e) Kogan sell a smart plug that has energy monitoring built in - this can be flashed OTA with Tuya to run Tasmota. You can then use the Tasmota rules engine to act on Power events etc.

I have 7 of these around the house for various things - some of them i use the rules engine - others just communicate to NR through MQTT and i act on power events through NR

Craig

Yeah, I just ordered a pair of Sonoff S31's and an adapter to be able to flash them with Tasmota. I learned about the rules. What does "flashed OTA with Tuya" mean? Is TUYA a program used to do the flashing once I've connected the smart plug to my mac using the adapter? Is there a way to do it without soldering (which is my plan)?

Incidentally, I have an update on the Currant outlet...

The engineering folks have been inspecting my logs with a debug version of their firmware I let them install. They found a bug in some header reading component. The code is supposed to detect bad bits in the header and map around them, but apparently, there was a bug for certain routines that just caused it to hang. The batch process code however didn't have the bug, which is why I was seeing things work with a long lag. They uploaded a new version of the firmware and the bug is now fixed. I now see my wattage threshold notifications within 2 seconds of flipping my wall switch.

They also, scanned their other customers and found 59 others who had evidence of the bug combined with bad bits in the "headers" and they're going to roll out an update.

So I looked into SmartThings, since the SmartThings wattage threshold trigger is now fast, but unless I write a "smartApp" (which seems insane), I would have to add my other smart plugs to SmartThings. I looked, and my 5 WeMo plugs are supported, but for some reason, they require me to have a WeMo hub to add them to SmartThings.

So I think that if I can get the flashed Sonoff plugs to work for me, I'll likely return the Currant.

Flashed OTA with Tuya - means that you do not need to open up the plugs - they use a chip known as TUYA - to there is a conversion program called Tuya Convert - quite easy to run on a Rpi (or a docker image which is how i do it)

Basically when the Smart plug first starts up there is a method to put it into flashing mode and you then do it all Over The Air (OTA), no need for cables or to open the devices .

Do the S31's do Energy monitoring ? I did not think they did (but have not checked or used them)

Craig

Yes they do! Just received them yesterday. I will have to try the OTA TUYA thing, though I did read about people who tried it and failed. Do you know of a good walk-through for the process? Like a YouTube vid or blog post using an rPi?

If these are genuine Sonoffs - then you will not have any problems - i do not think they have changed to the PSK system that does not allow flashing (but not positive on that)

Sorry i do not have a handy link to the Tuya flashing - i think i just use the link from the Tasmota Githib to the Tuya convert github.

THe way i did it - i downloaded a Docker image that had everything setup and put that onto my laptop, then fired it up with the necessarey parameters and went from there - it was very easy.

Craig

Oh my God. I had such a difficult time with the first sonoff and I'm wondering if maybe I damaged it because the power monitoring doesn't work on it.

I had gone the soldering route because I couldn't figure out the TUYA option and other people said the soldering would be easy.

But soldering the wires to it was so difficult. It took me over 2 hours just for the soldering because my hands would shake trying to hold the iron to the contacts. I even had the sonoff in a vice, tried holding my hand against something, and holding the wires in place with alligator clips. But the soldering tip is like 3 inches from the handle which would amplify the shaking. At one point, I thought I'd ruined it, getting the solder across 2 contacts, but I managed to remove it.

My first attempt was to use alligator clips without soldering, but it wouldn't flash that way. Then by the time I got the wires soldered, I was so exasperated that I forgot that the wires were in a different order than when I tried the alligator clips, so I wonder if that second flash attempt with the mixed up wires fried the power sensors when I tried flashing the second time... The third attempt though seemed to work after swapping the wires.

I ended up spending all day just trying to get it to work. It did flash and I can turn the outlet on and off, but I just can't get any energy stats. They're all 0. Even the voltage.

I may give the second sonoff a go in the morning, but I'm not looking forward to the struggle with soldering.

I then was able to flash the dev version of Tasmota OTA using their web GUI and I created an issue on their repo. I'm hoping they'll have some insight.

Rob

If you are having problems with a steady hand for soldering the pins onto a SONOFF, you might want to look at "pogo pins" these let you press into the holes without having to solder.

You might also look at the flexible helping hands if you don't already have them:

And one last thing that looks crazy but I've found a real godsend, especially with my somewhat aging eyes, a magnifying headset. This is the one that I got and I love it. Use it for so many things:

1 Like

Hey Rob,

Good progress - yep soldering onto the embedded Tuya chips is definitely no fun at all - all of the Sonoffs are meant to be Flash friendly - so they do not require this - the newer ones even provide a jumper to put them into flash mode - anyway - you are there now.

As to why no energy stats - i would guess you have not configured the unit as the correct type - it thinks it is just a basic relay unit.

You have to go into the configuration menu - then the Configure module - menu then choose the s31

Here is some more info on it

Craig

Also good to be aware of tasmota compatible devices (ie flashable), per device notes whether it is possible to flash or not.

Craig, the folks on the Tasmota github repo said that the wrong Sonoff S31. Apparently I had the "lite" version. That's why the energy readings were all 0.

Is it the "jumper" that allows one to avoid soldering or am inferring correctly that there's another way to avoid soldering?

Incidentally, I put 2 soldering things on my Xmas list: a roll of solder with and some "helping hands" alligator clip arms. I considered the magnifying glass google thing mentioned above, but though my I might just be able to use a magnifying glass held by one of the clips.

Bakman2 - the Tasmota folks gave me a direct Amazon link to the "right" one, so I'm hoping it will be able to be flashed.

I really do recommend the head-mounted version. I find it so useful for many things, not just soldering. It isn't that expensive and it gives you full stereoscopic vision whereas the magnifying glasses tend to be very restrictive (I have one of those on a helping hands unit but it is virtually useless and I don't recommend it).

Unfortunately, many of the Tuya based devices are moving to a new version that I don't believe allows for remote upgrades, so you have to open the device and get to the headers. You will find that most mains relay plugs use triangular socketed bolts for security. I had to buy a set of larger ones as my phone maintenance style screwdriver set didn't have ones large enough.

I have to say that while I have some SONOFF devices (including a POW where the relay has already died), I don't really trust them all that much. Certainly I would never run them at more than 50% of their rated power. The track separation is often quite poor and I'm never sure whether they have thermal fuse protection - certainly some of the early models went up in flames.

I finally decided to buy a bunch of Shelley's in the recent sale. 5 Shelley 1's (with two Buttons, I have some spare mains housings I will use for the others), 1 of the LED controllers and one of the power measuring relays. Something to play with in the new year.

Not sure what it is with our mains but we do seem to get through relays rather more often than I would like. They rarely seem to last more than 2-3 years. Though a few have done better.

Hmm,

Was not aware that they had a lite version so there you go.

I think most of the devices with the Tuya chips are either small embedded devices (like light bulbs etc) - most of the mainstream sonoff stuff seems to have the full chip (PowR2, Sonoff Basic etc etc)

The ones i have opened up to serial flash have all had easy through holes.

I have not yet come across a Tuya device that did not work with Tuya Flash - however Julian is correct in that their is a new version of PSK encryption that the newer devices and chips are using that does require a manual opening and solder/pogo pins.

Totally 2nd the helping hands (and the fact that the magnifying glass with them is useless) you defintiely want the head mounted unit

Craig

1 Like

Well I soldered and flashed the first of 3 sonoffs today. This time, with the magnifying headband and the helping hands, it took an hour and 15 minutes instead of 2 hours, so it's an improvement, though still really difficult.

I implemented my setup and I'm a little disappointed that it's a roughly 2 second delay. The notification of the Currant was only a fraction of a second - I just had no way to integrate it.

BTW, I also got a switcheroo for Christmas, which is a simpler version of the quirky switchflip, so I have some toys to play with. :wink:

Delay in what?

It is a long thread, isn't it?

The delay between power being turned on, (the wattage change being detected via a rule, and) communicating the wattage change to node red so I can make things happen (e.g. turn on another light).

The Currant outlet had a wattage threshold change notification that you could set up via the SmartThings app and that was really quick. I just had no way to get that into Node-RED.

If the timing of the messages in the concise are an accurate real time depictions, then it seem that the largest component of the delay is the frequency at which the rules run (or how fast they run). I wonder if I can tweak that to decrease the lag...

What rules are you talking about and where do they run?