Julienx
(Julien)
December 19, 2022, 5:58pm
1
Hi,
I would like to multiply two values that I get when I query about EPEVER inverter.
My configuration.yaml is :
modbus:
name: Epever
delay: 5
close_comm_on_error: true
retry_on_empty: true
retries: 10
type: serial
baudrate: 115200
bytesize: 8
method: rtu
parity: N
port: /dev/ttyACM0
stopbits: 1
sensors:
Utility
name: “Courant de sortie onduleur”
unit_of_measurement: A
slave: 10
address: 0x3522
input_type: input
scale: 0.01
precision: 2
name: “Tension de sortie onduleur”
unit_of_measurement: V
slave: 10
address: 0x3521
input_type: input
scale: 0.01
precision: 2
I tried with this :
name: "Puissance de sortie"
unit_of_measurement: "VA"
device_class: energy
state_class: total
state: '{{ ((state(sensor.courant_ondule) | float) * (state(sensor.tension_de_sortie_onduleur) | float)) | round(0) }}'
unique_id: "Puissance de sortie"
but it doesn’t work, i have “unavailable”
Can you help me please ?
nikito7
(nikito7)
December 19, 2022, 7:33pm
2
states('sensor.eb3_power_factor')|float(0)
Julienx
(Julien)
December 19, 2022, 7:47pm
3
like this ?
name: "Puissance de sortie"
unit_of_measurement: "VA"
device_class: energy
state_class: total
state: '{{ ((states('sensor.courant_ondule') | float(0)) * (states('sensor.tension_de_sortie_onduleur') | float(0))) | round(0) }}'
unique_id: "Puissance de sortie"
Thanks.
Julienx
(Julien)
December 19, 2022, 8:26pm
4
Now I have an error with the code proposal :
Error loading /config/configuration.yaml: while parsing a block mapping
in “/config/configuration.yaml”, line 204, column 9
expected , but found ‘’
in “/config/configuration.yaml”, line 208, column 30
The line 208 is :
state: '{{ ((states('sensor.courant_ondule') | float(0)) * (states('sensor.tension_de_sortie_onduleur') | float(0))) | round(0) }}'
nikito7
(nikito7)
December 19, 2022, 8:35pm
5
state: "{{ ((states('sensor.courant_ondule') | float(0)) * (states('sensor.tension_de_sortie_onduleur') | float(0))) | round(0) }}"
Julienx
(Julien)
December 19, 2022, 9:02pm
6
It’s perfect! it works! Thank you very much!
1 Like