Power measurement

223 views
Skip to first unread message

Andras

unread,
Nov 3, 2019, 11:20:27 AM11/3/19
to loxone-...@googlegroups.com
Wanted to share my setup of energy monitoring. I have purchased recently around 10 of the Sonoff POW R2 and flashed them with Tasmota (costs $14 / piece). Connected them to my wifi and wired these devices to monitor major consumers in my flat.

Works really great, was easy to setup and was quite cost efficient!

Screenshot 2019-11-03 at 17.15.42.png

 

Screenshot 2019-11-03 at 17.19.12.png



The setup is pretty straightforward:
  • Sonoff devices are using MQTT to communicate to mosquito (the MQTT broker running on a raspberry pi)
  • nodered running on the same pi listens for MQTT messages and pushes them into influx after some minor transformation
  • Grafana sits on top of Influx and displays charts

Rob_in

unread,
Nov 4, 2019, 1:31:58 AM11/4/19
to Loxone English
That's pretty sweet. Shame they don't do something similar that's connected with a wire (I don't like wireless) that you could put in the cabinet.

On Sunday, 3 November 2019 17:20:27 UTC+1, Andras wrote:
Wanted to share my setup of energy monitoring...

Andras

unread,
Nov 4, 2019, 3:02:58 AM11/4/19
to Loxone English
I feel your pain... I am coming from the same mindset too. Was long searching for a wired option, but it seems that there's no commonly available (ie: cheap) ethernet based mini-computer. The ESP8266 is hard to beat.

Luckily for me, when designing my flat, I opted for star schema based wiring, so I did have the option to experiment with power sensing KNX relays (MDT AZI - ~40€/channel) but they required a lot of space in my cabinet which I don't have. Not to mention the price.

The sonoff+tasmota setup has been working flawlessly for months now without missing measurements. Dedicated though a separate wireless network for IoT crap on my unifi setup. Just ordered 10 more of the sonoff's :)

Jan De Bock

unread,
Nov 5, 2019, 12:03:25 AM11/5/19
to Loxone English
This is indeed interesting. It is certainly useful if you know your main consumers.
I am looking for a solution for energy based switching based on own production versus consumption. In Belgium it will become soon cheapest if you consume your own produced energy rather then injecting it on the net. So I want to switch some devices based on this. Eg washing machine, pool pump (partially), electric vehicle (future), etc
Any ideas how to do this?

Rob_in

unread,
Nov 5, 2019, 1:48:58 AM11/5/19
to Loxone English
This is very interesting all the same.

If you Google 'ESP8266 Modbus' then looks like it's would be easy enough to add a wired Modbus interface to any ESP8266 device. You could then use these to both control the relay and poll the device for power readings. Given you are already playing with the firmware seems to me adding Modbus would be easy enough.

If you don't have a Loxone Modbus Extension but absolutely won't live without wires it would also be pretty easy to use an RPi on wired internet as a gateway to some kind of serial control over a number of Sonoff modules. That said, RPi relays are soooo cheap (like 1EUR/channel) then why not just use them, then add a current sensor for a couple bucks more (ACS712ELC sensors + ADS1115 ADC)?

Bit too home brew*? ;)

Robin

*I don't like using DIY gear in the main house, but do have an RPi based 'extension' in the garage that works great and has a number of relays, switches and sensors connected to it.

Tom Bernaerd

unread,
Nov 13, 2019, 9:27:21 AM11/13/19
to Loxone English
Hi Andras, 

Did you splice the wires for your devices to add in the Tasmota devices then? 
I would like to add some to my network as well, just as a cheap alternative to the Loxone Socket Air, but I don't really like the form factor. 
I'm looking at the Sonoff S26 now but it seems like they are way harder to solder programming wires to.

Does anyone know if there is a version that plugs in directly and can easily be flashed to Tasmota? 

Tom 

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loxone-english/de07a344-9284-4d7e-b113-cff90830d7a1%40googlegroups.com.

Andras

unread,
Nov 14, 2019, 5:05:47 PM11/14/19
to Loxone English
Hey, I took a one meter long extension cable, cut it in half, connected the two ends to the in/out of the Sonoff POW R2. This way I have a nice extension cable with sonoff "in it" that's highly mobile, and was very cost effective. 

Previously I was also looking for a plug that I could flash with Tasmota, but it seems that most manufacturers closed (patched) the over-the-air flashing possibilities (ie: tuya-convert). Most plugs you could flash if you have access to their serial ports but usually these require heavy disassembly / damage. This is how I ended up with POW R2's that is easy to open and the serial port is very accessible.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-...@googlegroups.com.

Rydens

unread,
Nov 15, 2019, 3:31:31 AM11/15/19
to Loxone English
Another popular one that I am very impressed with is Shelly https://shelly.cloud/. They have a range of relays and other products. Good software supplied, but also they provide instructions of how to reflash with no disassembly (ports are available). They are WiFi enabled, but also still work as a physical switch even if WiFi is down - good resilience.
Cheers David

Tom Bernaerd

unread,
Feb 16, 2020, 3:17:31 PM2/16/20
to andra...@gmail.com, Loxone English
Hi Andras, 

I have bought some Sonoff Pow R2's and flashed them with Tasmota. So far so good.
I also tried to get the data into Influx via MQTT but so far my attempts have failed. Telegraf has an mqtt_consumer that should work in theory but does not in practice, probably because the Tasmota's are sending one big JSON with their telemetry data and not individual values:

21:15:56 MQT: tele/freezer/SENSOR = {"Time":"2020-02-16T21:15:56","ENERGY":{"TotalStartTime":"2020-02-11T11:30:54","Total":1.959,"Yesterday":0.425,"Today":0.362,"Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Factor":0.00,"Voltage":239,"Current":0.000}}

Then I stumbled upon Espurna firmware which contains InfluxDB support out of the box. Then it turns out you have to create your own builds to do so and the docs are severely lacking. Shame, cause that would have been the easiest option. 

So, could you please point me in the right direction to replicate your nodered way of pushing the data to Influx? 

Best regards, 
Tom 

To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loxone-english/16cd5d47-9e7a-40ab-8b1f-caa80a127079%40googlegroups.com.

Andras

unread,
Apr 17, 2020, 1:06:23 PM4/17/20
to Loxone English
Hi Tom,

Sorry for the delay, here's how I have done it.

I have a few node flows, like the following: 



The top left node is an mqtt in node, while the nodes on the bottom right are the node-red-contrib-influxdb influxdb out nodes with a connection and a measurement name set.

The create influx object nodes are simple function nodes with some javascript in it:

if (msg.payload.AM2301.Humidity === null)
   
return null;
   
return {
   
"payload": [ { "value": msg.payload.AM2301.Humidity }, { "room": "bence" }]
}


The format is rather simple: you need to submit an array in the payload with two items in it: first item should be the fields (measurement values), second item should be the tags you would like to attach to each data point.

Cheers,
András

Reply all
Reply to author
Forward
0 new messages