I want to multiply two sensors retrieving voltage and current information to get the power.
I thus obtain the charging power and the discharging power.
For the moment with all the configurations I try, I get the unknown information.
here are my tests templates:
template:
- sensor:
- name: "Puissance décharge Batterie"
unit_of_measurement: 'W'
device_class: power
state: "{{((states('sensor.batt_discharge_current')| float(0) * states('sensor.battery_voltage')| float(0))) | round(2) }}"
Or
- name: "Puissance charge Batterie"
unit_of_measurement: "W"
device_class: power
state: >
{{ [ states('sensor.battery_voltage'),
states('sensor.battery_charge_current') ]
| map('float') | multiply }}
availability: >
{{ not 'unavailable' in
[ states('sensor.battery_voltage'),
states('sensor.battery_charge_current') ] }}`
But nothing happened
Thanks for your support