Hi all,
I’m using Home Assistant, on a personnal server, without Hassio.
I’m not sure to be on the right way, so, I will explain my situation and goals first before talking about histogram.
I’m playing with Pzem004t-v3 and esp12F to measure power consumption of some element in my house (water heater, watrer pump and so on).
Integration is working fine, I can get voltage, current, power and energy.
I created sensors in configuration.yaml that give me daily and monthly consumption peaks and offpeaks period.
Each starting days, those values are reset and lost. Now, I would like to savec them into news sensors, in order to get a kind of histogram.
I have two questions
1- Am I on the right way?
2- if yes, how can I change histo cumulus value in an automation action
I know that state doesn’t exist, It is just an example of what I want to do)
Unfortunately this may not work as a template sensor is a local push sensor not a polling sensor so the scan interval trick may not work. Try it and see. If it does not work I have another way to do it.
Thanks for your answer. I will try this, and give here updates!
EDIT : I got this error:
Invalid config for [sensor.template]: [update_interval] is an invalid option for [sensor.template]. Check: sensor.template->sensors->histo_cumulus->update_interval. (See ?, line ?
Maybe I miss something, but the configuration is stil invalid. Invalid config for [sensor.template]: [scan_interval] is an invalid option for [sensor.template]. Check: sensor.template->sensors->histo_cumulus->scan_interval. (See ?, line ?).
It seems that scan_interval is only available for platform, not for sensors.
Here is my conf in configuration.yaml.
sensor:
- platform: template
sensors:
histo_cumulus:
friendly_name: "histo cumulus"
unit_of_measurement: '€'
value_template: "states('sensor.facture_cumulus')"
scan_interval: 9999999999 # 317 years. Essentially it will never update