Template sensors with multiple batteries #646
jontraceyuk
started this conversation in
General
Replies: 1 comment 10 replies
-
Are these B2 and B3 sensors available anyway? I have two batteries which are in parallel on one (1) inverter and represent them as one (B1) battery. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Quick YAML question: taking the example code provided for the sensors, if I have more than one battery (in this case 3), do I need to add up the sum of the batteries
eg - the example code
unit_of_measurement: "W"
device_class: "power"
state_class: "measurement"
# The net of DC power from inverter and battery, only if this is positive
state: "{{ max([float(states('sensor.solaredge_i1_dc_power'), 0) + float(states('sensor.solaredge_b1_dc_power'), 0), 0]) }}"
availability: "{{ has_value('sensor.solaredge_i1_dc_power') and has_value('sensor.solaredge_b1_dc_power') }}"
Should i replace the line state: "{{ max([float(states('sensor.solaredge_i1_dc_power'), 0) + float(states('sensor.solaredge_b1_dc_power'), 0), 0]) }}"
availability: "{{ has_value('sensor.solaredge_i1_dc_power') and has_value('sensor.solaredge_b1_dc_power') }}"
with something like
state: "{{ max([float(states('sensor.solaredge_i1_dc_power'), 0) + float(states('sensor.solaredge_b1_dc_power')+ float(states('sensor.solaredge_b2_dc_power')+ float(states('sensor.solaredge_b3_dc_power'),, 0), 0]) }}"
availability: "{{ has_value('sensor.solaredge_i1_dc_power') and has_value('sensor.solaredge_b1_dc_power') }}"
Beta Was this translation helpful? Give feedback.
All reactions