My first post in this community. Mostly noobish person here so if my questions sound wrong my apologizes in advance.
I have HA up and running. Devices added. Everything is there. What I am struggling with is creating templates/sensors from multiple sensor values. I have tried copying/mimicking many guides to no avail.
For example from entities:
sensor value 1: sensor.inverter1qpigs_pv1_charging_power
sensor value 2: sensor.inverter2qpigs_pv1_charging_power
How do I go about adding these values together to create new sensor? Is more information needed?
Yes, copy and paste the complete template sensor in your configuration.yaml. If this is your first time creating template sensor, you will need to restart Home Assistant from Configuration → Server Control → Restart.
Next time, if you add more template sensor you can just reload Template Entities from Configuration → Server Control → YAML configuration reloading → Template Entities.
Thank you for the help yesterday. I got the hang of adding up sensor values. Now I have different question.
I have entity sensor.shunt_instantaneous_power which has both positive and negative values. I am trying to create new sensor which will display only positive values or that entity or 0 for negative values. Is that possible?
Thank you again. In above template 1000 can be any number I would assume? Well, I guess I will see once the solar system starts producing today.
Now for the negative values of the shunt measurement. How can that negative value be converted into positive. Reason for my asking is because of the requirement of this card Tesla Style Card
From git hub page:
**templates for missing sensors or for negative sensors
Remember you can create template sensors if you are missing one like solar yield out of solar_consumption and grid_feed_in or if you are missing another one like home_consumption. Some inverters have positive and negative values, here all sensors need to be positive values, so create template sensors like:
battery_consumption:
value_template: '{% set batter_cons = sensor.powerwall_battery_now | int %}
{% if batter_cons > 0 %}
{{ batter_cons | int }}
{% else %}
0
{% endif %}'
device_class: power
unit_of_measurement: W**
Solution to show Power Wall (negative) discharge values of the sensor as positive and showing 0 for all the positive values of the sensor. It works. Thank you again. Would you change anything?
I have similar question. I would like to have data from multiple sensors and get mean value, but statistics platform does not support multiple entities. Any ideas for this?