Page 1 of 1

which device to choose for costs tracking ?

Posted: Sunday 27 November 2022 18:51
by willemd
Which device is best used for cost tracking? Or should we request a new device?

I am currently using a custom device to store the electricity costs during the day (=today's nett usage times price) . This could increase or decrease during the day, depending on usage and/or return as well as positive/negative price.

Issue is that daily values of custom devices are stored in the percentage_calendar table and only show min, max and avg in the table and daily graphs, no totals.

I would like to have a device that shows a total per day (and per month), just like counter devices. But a counter cannot be used for the costs since counters can only increase.

Any other suitable device available?

Re: which device to choose for costs tracking ?

Posted: Sunday 27 November 2022 22:21
by waltervl
In principle the costs are available in the report function of the energy devices. So probably this is the reason there is no cost device.

Re: which device to choose for costs tracking ?

Posted: Sunday 27 November 2022 23:39
by FlyingDomotic
You may use RFXmeter, with a "counter" type, value "Cost" and unit "€" (or whatever currency you're using).

Re: which device to choose for costs tracking ?

Posted: Monday 28 November 2022 14:24
by willemd
waltervl wrote: Sunday 27 November 2022 22:21 In principle the costs are available in the report function of the energy devices. So probably this is the reason there is no cost device.
That only allows the setting of rates per kWh and M3 and does not take into account fixed charges and/or returns per day/month, nor any variation in the charges depending on the time or situation.

I am now simulating the costs I would have if I had a dynamic contract with hourly variation of electricity prices (a lot of companies are now offering such contracts).

Re: which device to choose for costs tracking ?

Posted: Monday 28 November 2022 14:24
by willemd
FlyingDomotic wrote: Sunday 27 November 2022 23:39 You may use RFXmeter, with a "counter" type, value "Cost" and unit "€" (or whatever currency you're using).
I thought this only allowed counter increase, but I will test. Thanks.

Re: which device to choose for costs tracking ?

Posted: Wednesday 30 November 2022 18:38
by willemd
willemd wrote: Monday 28 November 2022 14:24
FlyingDomotic wrote: Sunday 27 November 2022 23:39 You may use RFXmeter, with a "counter" type, value "Cost" and unit "€" (or whatever currency you're using).
I thought this only allowed counter increase, but I will test. Thanks.
I can now confirm that a counter devices does NOT handle negative values correctly and therefore is useless for handling increasing and decreasing costs.

I have the following values:
1) a startvalue 504
1) next value 509
2) 506
3) 495
4) 490
5) 488
6) 491

A custom sensor does display the increase and decrease correctly (but with the useless min,max,avg in the monthly graphs as stated above)
A counter device displays in the daily graph:
+5
+506
+495
+490
+488
+3
So for negative values it does not display the decrease (for example minus 0.03) but the new counter total minus the decrease (for example 5.09 minus 0.03 = 5.06) . whereas for positive numbers it just shows the increase like it should (note the device has a divider of 100)
Daily cumulative total shown in the icon is correct however, i.e. not adding the large positive numbers but subtracting the small negatives.
(this is in the daily graph, I don't have negative values in the other graphs yet)

So, back to my initial question .....

Below is the XLS download of the graph and the corresponding selection from the meter table and the calculation of difference from one meter value to the next.

Code: Select all

Displayed in graphs (xls download)			value in meter table	(difference to next value)/100
DateTime	Costs			
2022-11-29 18:00:00	0,27					261				0.27
2022-11-29 19:00:00	0,36					288				0.36
2022-11-29 20:00:00	0,25					324				0.25
2022-11-29 21:00:00	0,2					349				0.2
2022-11-29 22:00:00	0,16					369				0.16
2022-11-29 23:00:00	0,05					385				0.05
2022-11-30 00:00:00	0,21					390				0.21
2022-11-30 01:00:00	0,21					411				0.21
2022-11-30 02:00:00	0,04					432				0.04
2022-11-30 03:00:00	0,04					436				0.04
2022-11-30 04:00:00	0,04					440				0.04
2022-11-30 05:00:00	0,04					444				0.04
2022-11-30 06:00:00	0,06					448				0.06
2022-11-30 07:00:00	0,07					454				0.07
2022-11-30 08:00:00	0,21					461				0.21
2022-11-30 09:00:00	0,22					482				0.22
2022-11-30 10:00:00	0,05					504				0.05
2022-11-30 11:00:00	5,06					509				-0.03
2022-11-30 12:00:00	4,95					506				-0.11
2022-11-30 13:00:00	4,9					495				-0.05
2022-11-30 14:00:00	4,88					490				-0.02
2022-11-30 15:00:00	0,03					488				0.03
2022-11-30 16:00:00	0,06					491	

Issue of incorrect graph display raised as an issue on github.

Re: which device to choose for costs tracking ?

Posted: Monday 05 December 2022 8:35
by Zuikkis
I made my own topic yesterday, didn't notice this was already discussed. Better keep in same place.

Interesting thing is, normal kWh counter already supports negatives, no issues there. I think you could just leave units at kWh and pretend they are euros. However if you change counter type to "custom" so you can change units to €, negatives no longer work.

Proof of the kWh negatives thingy, my kWh readings from last summer:
Kuvakaappaus 2022-12-05 09-35-02.png
Kuvakaappaus 2022-12-05 09-35-02.png (118.73 KiB) Viewed 983 times

Re: which device to choose for costs tracking ?

Posted: Monday 05 December 2022 19:01
by Zuikkis
gizmocuz explained I had a bug in my managed counter code, it works now. see here:

viewtopic.php?p=295431#p295431

Re: which device to choose for costs tracking ?

Posted: Tuesday 20 December 2022 11:57
by willemd
see final conclusion in this post:

viewtopic.php?p=296335#p296335