Calculated energy consumption off?

Moderator: leecollings

Post Reply
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Calculated energy consumption off?

Post by olleman »

Hello!

I have a power meter on my boat and meassure charge and discharge in two different uility devices. This is how the graph for discharge looks right now.
energy.JPG
energy.JPG (42.39 KiB) Viewed 1467 times
The maximum consumption is 280w and minimum 220w. So how can domoticz calculate it to be 354Wh per hour?
I use the input data to feed an electric counter in domoticz as well and this counter gets it right with about 240wh per hour.
energy counter.JPG
energy counter.JPG (46.67 KiB) Viewed 1467 times
Any ideas?
User avatar
waltervl
Posts: 6683
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Calculated energy consumption off?

Post by waltervl »

How do you measure the power usage (220-280Watt)? Script or plugin or http json updates? What data is send to Domoticz? What type and subtype of Energy device is used (from setup - device list)?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

Thanks for answering!

I meassure with an INA219 sensor and wemos d1 mini running espeasy. Using rules in espeasy I update the power measured every 10 seconds.
The counter that I use as a control uses the exact same data and is being updated via a script in domotics every time the energy meter gets an update.

The energy meter is an electric (instant + counter) with subtype "usage".

Look at my first graph, doesn't it look peculiar just by looking at it? All power readings are between 220-280. It's not possible to get more than 280wh per hour but still it's being calculated to more than 300wh.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Calculated energy consumption off?

Post by waaren »

olleman wrote: Wednesday 28 April 2021 21:00 Look at my first graph, doesn't it look peculiar just by looking at it? All power readings are between 220-280. It's not possible to get more than 280wh per hour but still it's being calculated to more than 300wh.
What do you see when you enter below http calls from your browser address bar?

Code: Select all

http://<>domoticz ip:domoticz port>/json.htm?type=graph&sensor=counter&range=day&method=1&idx=<idx>
http://<>domoticz ip:domoticz port>/json.htm?type=devices&rid=<idx>
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waltervl
Posts: 6683
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Calculated energy consumption off?

Post by waltervl »

And when you edit the device can you switch Energy Read between from device and computed? And what is it's setting now?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

waaren wrote: Wednesday 28 April 2021 21:42
olleman wrote: Wednesday 28 April 2021 21:00 Look at my first graph, doesn't it look peculiar just by looking at it? All power readings are between 220-280. It's not possible to get more than 280wh per hour but still it's being calculated to more than 300wh.
What do you see when you enter below http calls from your browser address bar?

Code: Select all

http://<>domoticz ip:domoticz port>/json.htm?type=graph&sensor=counter&range=day&method=1&idx=<idx>
http://<>domoticz ip:domoticz port>/json.htm?type=devices&rid=<idx>
The output for the first one consists of a lot of "220" values and a few "280" and of course the sums of every hour at about ~340wh per hour.

The second one gives me this output:

Code: Select all

{
	"ActTime" : 1619688711,
	"AstrTwilightEnd" : "00:00",
	"AstrTwilightStart" : "00:00",
	"CivTwilightEnd" : "21:46",
	"CivTwilightStart" : "04:29",
	"DayLength" : "15:38",
	"NautTwilightEnd" : "22:57",
	"NautTwilightStart" : "03:18",
	"ServerTime" : "2021-04-29 11:31:51",
	"SunAtSouth" : "13:08",
	"Sunrise" : "05:18",
	"Sunset" : "20:57",
	"app_version" : "2021.1",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "0, 220.00",
			"Description" : "",
			"EnergyMeterMode" : "1",
			"Favorite" : 1,
			"HardwareDisabled" : false,
			"HardwareID" : 2,
			"HardwareName" : "Rpi3",
			"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
			"HardwareTypeVal" : 15,
			"ID" : "00082013",
			"LastUpdate" : "2021-04-29 11:31:51",
			"Name" : "Batterif\u00f6rbrukning",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "kWh",
			"SwitchTypeVal" : 0,
			"Timers" : "false",
			"Type" : "General",
			"TypeImg" : "current",
			"Unit" : 1,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "13"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}
}
Last edited by olleman on Thursday 29 April 2021 11:33, edited 3 times in total.
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

waltervl wrote: Wednesday 28 April 2021 22:59 And when you edit the device can you switch Energy Read between from device and computed? And what is it's setting now?
It's set at "computed now" since my device only send the current power usage 6 times each minute.

I tried setting it to "device". The log stays the same but I'm not getting any numbers at all from the device now. Even after I changed it back to "computed" the device still doesn't show any reading!? Any idea how to get it back :)?
power2.png
power2.png (26.42 KiB) Viewed 1421 times
Last edited by olleman on Thursday 29 April 2021 11:40, edited 1 time in total.
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

Here's the complete output with the data from the sensor.
Attachments
energy.txt
(54.93 KiB) Downloaded 76 times
User avatar
waltervl
Posts: 6683
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Calculated energy consumption off?

Post by waltervl »

olleman wrote: Thursday 29 April 2021 8:21 It's set at "computed now" since my device only send the current power usage 6 times each minute.
I tried setting it to "device". The log stays the same but I'm not getting any numbers at all from the device now. Even after I changed it back to "computed" the device still doesn't show any reading!? Any idea how to get it back :)?
Oops, I did not want to break something. "Computed" seemed to be the right setting in your case. Device is only needed when the device is sending the usage on its own. Seems indeed that in your case the compute function is not computing right.
Do you see any reading in device list? Perhaps CtrL-F5 on the page with the empty device widget?
Anything in the log file for this device?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

waltervl wrote: Thursday 29 April 2021 16:14
olleman wrote: Thursday 29 April 2021 8:21 It's set at "computed now" since my device only send the current power usage 6 times each minute.
I tried setting it to "device". The log stays the same but I'm not getting any numbers at all from the device now. Even after I changed it back to "computed" the device still doesn't show any reading!? Any idea how to get it back :)?
Oops, I did not want to break something. "Computed" seemed to be the right setting in your case. Device is only needed when the device is sending the usage on its own. Seems indeed that in your case the compute function is not computing right.
Do you see any reading in device list? Perhaps CtrL-F5 on the page with the empty device widget?
Anything in the log file for this device?
Refresh with CTRL-F5 or even trying in incognito mode doesn't solve the problem. Under devices it seems "stuck" it's showing new updates with new values all the time but the value is always "280" which can't be right. almost 9/10 readings are 220 so something happened here...perhaps the database got corrupt for this particular device? It's not the end of the world, I can always make a new device but it's always nice to find the solution :)

So now I've got two problems it seems :)
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

hm...problem solved.

I had to recreate the sensor to get rid of the problem with it not updating at all. And guess what!? It now calculates correctly. Not only that, recreating another sensor I have for total battery consumption now allows for negative values. I guess I created these sensors a couple of years ago and things have changed since then, but only for newly created sensors!
User avatar
waltervl
Posts: 6683
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Calculated energy consumption off?

Post by waltervl »

Ok, well glad it was solved..
you know there is a replace function so you can copy the history data if the old in the new device if needed?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
olleman
Posts: 107
Joined: Thursday 01 January 2015 18:56
Target OS: Linux
Domoticz version:
Contact:

Re: Calculated energy consumption off?

Post by olleman »

waltervl wrote: Friday 30 April 2021 18:29 Ok, well glad it was solved..
you know there is a replace function so you can copy the history data if the old in the new device if needed?
Yes, but the problem persisted when I used that function so I used brand new ones.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest