Electric (instant+counter) - Domoticz doesn't compute Energy

Easy to use, 100% Lua-based event scripting framework.
Post Reply
jake
Posts: 432
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Electric (instant+counter) - Domoticz doesn't compute Energy

Post by jake » Friday 09 February 2018 9:45

I'm feeding an 'Electric (instant + counter)' device only with the (generated) power.

Code: Select all

device.updateElectricity(power in watts)
I would like Domoticz to do the calculation of energy. Although showing/tracking the power value during the day, the Energy counter stays 0, day after day.

I know it can work, because my micro-inverters of the solar panels update themselves (power only) through a json command to the same type of virtual device and there the Domoticz computing of Energy is very reliable.

I tried it to feed the device like this:

Code: Select all

device.updateElectricity(power in watts, 0)
but this doesn't help. Or

Code: Select all

device.updateElectricity(power in watts, '')
but that gives an error.

dannybloe
Posts: 1461
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: Electric (instant+counter) - Domoticz doesn't compute Energy

Post by dannybloe » Friday 09 February 2018 18:28

I suspect this is a Domoticz problem. I'm only setting the commandArray and send that back to Domoticz.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

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

Re: Electric (instant+counter) - Domoticz doesn't compute Energy

Post by jake » Friday 16 March 2018 23:00

dannybloe wrote:
Friday 09 February 2018 18:28
I suspect this is a Domoticz problem. I'm only setting the commandArray and send that back to Domoticz.
In this topic a possible solution was given to let the electrical device compute energy properly, by feeding the device through json.

To test this I used 2 virtual 'Electrical (counter + incremental)' sensors. The 1st one is fed by this dzVents command:

Code: Select all

local currentpower = (inv1.WhActual + inv2.WhActual + inv3.WhActual + inv4.WhActual + inv5.WhActual)
totSolar.updateElectricity (currentpower,0) 
The 2nd one is fed by this json command in dzVents:

Code: Select all

local solarUrl = 'http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=295&nvalue=0&svalue='..currentpower..';0'
		domoticz.openURL({
			url = solarUrl,
			method = 'GET'
			})
the 2nd sensor is being updated by the json command and after sometime it starts to count/compute energy as well.

2 days later I started updating the 1st sensor as well with the json command: within a short time the device started to compute energy.

Summarizing: something is going on with the LUA code to update the electrical device, while through json it works as expected.

User avatar
McMelloW
Posts: 193
Joined: Monday 20 November 2017 18:01
Target OS: Raspberry Pi
Domoticz version: V3.beta
Location: Harderwijk, NL
Contact:

Re: Electric (instant+counter) - Domoticz doesn't compute Energy

Post by McMelloW » Saturday 17 March 2018 1:44

dannybloe wrote:
Friday 09 February 2018 18:28
I suspect this is a Domoticz problem. I'm only setting the commandArray and send that back to Domoticz.
If this is a Domoticz problem, who can we contact to look at it? There are several topics about it and an issue #2196 is openeded. But nothing so far.
Greetings McMelloW

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

Re: Electric (instant+counter) - Domoticz doesn't compute Energy

Post by jake » Friday 23 March 2018 21:29

The 1st sensor 'computed' energy for 2 days. Both days had exactly the same 'Energy' harvest. Ths is incorrect. On day 3 the sensor didn't compute anymore.
The 2nd sensor keeps computing correctly.

Something is completely screwed with counters. I have the same kind of problems with counting in m3 gas. I simply can't get my finger behind it, but values are not correct.

mraichura
Posts: 11
Joined: Friday 16 December 2016 5:59
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Rajkot, IN
Contact:

Re: Electric (instant+counter) - Domoticz doesn't compute Energy

Post by mraichura » Friday 22 June 2018 12:20

Hello All,

I'm receiving total current load via MySensors and voltage from a Sonoff POW. I then created a dummy sensor as follows

Code: Select all

Idx: 46
Sensor Type: Electric (Instant + Counter)
Type: Usage
Energy Read: Computed
The power wattage is calculated in Node-Red and sent to Idx: 46 via MQTT. The payload is as follows.

Code: Select all

{
    "idx": 46,
    "nvalue": 0,
    "svalue": "5191;0.000"
}
It was working fine from June 6 until a couple of hours ago. Now, the sensor value in Watts is visible but computed Energy usage (Total & Today) show nan.
Domoticz.png
Domoticz.png (15.3 KiB) Viewed 326 times
Any help?
1 x RASPBERRY PI 1 MODEL B+ running Domoticz since June 2016
1 x RASPBERRY PI 3 MODEL B running Domtoicz since August 2017

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests