ESP Easy and POW R2

Post Reply
Prutsium
Posts: 19
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version:
Contact:

ESP Easy and POW R2

Post by Prutsium » Monday 18 June 2018 11:45

Hello all,

I started already a topic on the ESPEasy forum in regards of the support for the POW R2 and this is implemented now.
But i run in some issues mainly related to Domoticz.

First as ESPEasy sends all 4 values to 1 IDX i had to split them up and thats perfectly working via:

Code: Select all

On POW_2_Sensors#POW_2_Voltage do
SendToHTTP 192.168.99.5,8080,/json.htm?type=command&param=udevice&idx=93&nvalue=0&svalue=[POW_2_Sensors#POW_2_Voltage] //Send the Voltage data to Domoticz
SendToHTTP 192.168.99.5,8080,/json.htm?type=command&param=udevice&idx=94&nvalue=0&svalue=[POW_2_Sensors#POW_2_Power] //Send the Watt data to Domoticz
SendToHTTP 192.168.99.5,8080,/json.htm?type=command&param=udevice&idx=95&nvalue=0&svalue=[POW_2_Sensors#POW_2_Current] //Send the Amp data to Domoticz
SendToHTTP 192.168.99.5,8080,/json.htm?type=command&param=udevice&idx=96&nvalue=0&svalue=[POW_2_Sensors#POW_2_Pulses] //Send the Usage data to Domoticz
endon
And i am able to get all the 4 values in Domoticz.
The tricky part comes for the pulse counter. As ESPEasy is using an rotating pulse counter that counts from 0 - 65535 and then restarts at 0 it seems Domoticz is not able to handle that. (As far as i could figure out 12530 pulses would be 1KW) https://github.com/letscontrolit/ESPEas ... SE7766.ino

Anybody a clue how to add this rotating pulse counter as power meter to Domoticz?

jake
Posts: 421
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: ESP Easy and POW R2

Post by jake » Monday 18 June 2018 11:56

By adding a couple extra lines to your script: put the current counter in a variable and compare next time. If new < old then usage is (new+65k) - old. New pulse value is current pulse value + usage.
Only send that calculated value to the domoticz idx.

Prutsium
Posts: 19
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: ESP Easy and POW R2

Post by Prutsium » Monday 18 June 2018 12:44

jake wrote:
Monday 18 June 2018 11:56
By adding a couple extra lines to your script: put the current counter in a variable and compare next time. If new < old then usage is (new+65k) - old. New pulse value is current pulse value + usage.
Only send that calculated value to the domoticz idx.
Not sure how to do that within ESPEasy .....

Prutsium
Posts: 19
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: ESP Easy and POW R2

Post by Prutsium » Thursday 21 June 2018 15:48

Btw ... this is how Domoticz handles right now the incoming data from the POW (R2)
Image

Keep in mind i did not set any divider yet but its clear to see its not adding but just restarting the counter.

User avatar
sincze
Posts: 926
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi
Domoticz version: 3.8875
Location: Netherlands
Contact:

Re: ESP Easy and POW R2

Post by sincze » Sunday 24 June 2018 20:39

Prutsium wrote:
Monday 18 June 2018 12:44
jake wrote:
Monday 18 June 2018 11:56
By adding a couple extra lines to your script: put the current counter in a variable and compare next time. If new < old then usage is (new+65k) - old. New pulse value is current pulse value + usage.
Only send that calculated value to the domoticz idx.
Not sure how to do that within ESPEasy .....
I guess this pointer is for ESPEasy to create a rule under rules to do this for you.
Rules are explained on the https://www.letscontrolit.com/wiki/inde ... rial_Rules

Store the 'old' values in a ESP Task with HW Dummy and do the calculation.
Currently I haven't prepared my R2 with ESPEASY as I did not notice the progress that it actually works ;-) now.
Using Pass2php since 2016-12
LAN: RFLink, P1-Port, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266, Xiaomi Gateway
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest