Hi All,
I am trying to use a custom component to display the power distribution in my house. It is called power distribution card (you can find it here: LINK and it has a nice graphical overview to show on your dashboard.
For this to work, I have to create some template sensors, which convert everything into watts and calculates the correct values. I use the following code to do this:
sensor:
- platform: template
sensors:
powercard_solar:
friendly_name: 'PCard Zonnepanelen'
unit_of_measurement: 'W'
value_template: "{{states('sensor.zonnepanelen_output_w') | float | round(0)}}"
powercard_net:
friendly_name: 'PCard Stroomnet'
entity_id: 'sensor.zonnepanelen_output_w'
unit_of_measurement: 'W'
value_template: >-
{% set cons = (states('sensor.power_consumption') | float * 1000) | round(0) %}
{% set prod = (states('sensor.power_production') | float * 1000) | round(0) %}
{{ cons - prod }}
powercard_home:
friendly_name: 'PCard Thuisverbruik'
entity_id:
entity_id: 'sensor.zonnepanelen_output_w'
unit_of_measurement: 'W'
value_template: >-
{% set zon = states('sensor.zonnepanelen_output_w') | float | round(0) %}
{% set prod = (states('sensor.power_production') | float * 1000) | round(0) %}
{{ zon - prod }}
The calculations are all working and show the correct values. However, the update of my solar panels data (sensor.zonnepanelen_output_w) is much less frequent then the values of my power meter (sensor.power_production & consumption). This can lead to display strange distribution of the power when there is provide lots of power to the grid, but the solar panels sensor is not updated yet. So basically the update of ‘powercard_net’ and ‘powercard_home’ should only occur right after ‘sensor.zonnepanelen_output_w’ (or the template sensor ‘powercard_solar’) is updated.
I already tried to set the ‘sensor.zonnepanelen_output_w’ as entity id. Although this indeed triggers an update when a new solar panel output comes in, the sensors are still also updated when the power meter values change.
I know I can manually force an update via an automation and the sensor update service, but how can I disable the auto-update of these sensors? Thanks for any help!