I am trying to bend my head aroud how to make a sensor to track the electricity cost, as the delivering company plans to switch from a time based tariff to a power based one.
Today there are two tariffs, high and low based on time of date and year. This was simple to implement with tariff changing automation.
The soon-to-come power based tariff is a bit more complicated for me in HA, as it is based on the average of the period’s (calendar month) three peaks for 1h power consumption (kW) per day.
Ie the cost is calculated as an average of those three readings, multiplied with a constant ($/kW) set by the electicity company.
For any given month the sensor will need to capture the three topmost power readings from the smart meter - or as it seems now, from Influx.
Keeping track of one max should be fairly easy, but keeping track of highest, second highest and third highest feels a bit trickier.
As often happens when my own knowledge runs out and I give a shout here, there’s something entirely new for me - this time the usage of & and * in references. I found it used in a few posting here but not enough to actually grasp its usage, can you please point me to the valkd documentation, or elaborate on it here.
So unsorted_sensors is basically passing the list of sensors to variables.sensors and sorted_variables is being passed to variables in the other trigger.
So you only have to manage 1 list of sensors and 1 variable section. Otherwise you’d have to copy/paste it multiple times.