hi I’m trying to calculate something
template:
- sensor:
- name: "CurrentCost Power"
unit_of_measurement: 'W'
state: '{{ state_attr("sensor.current_cost", "Appliance 0") | float }}'
device_class: power
state_class: measurement
- sensor:
name: "mypf"
unit_of_measurement: 'W'
state_class: measurement
device_class: power
state: >
'{{ (states("sensor.energy03_energy_voltage") | float / 240.0) | round(3) }}'
- sensor:
name: "vawatts"
unit_of_measurement: 'W'
state_class: measurement
device_class: power
state: '{{ state_attr("sensor.current_cost", "Appliance 0") | float }}'
sensor current cost measures va but the v in va is wrong
mypf takes a voltage reference and divides by 240 this is a string value of 0.9xx usually
vawatts is the same value as sensor current _cost
What I am trying to do is create a sensor which has a value of vawatts * mypf
but they are both strings and thats not permitted.
how do i create my new sensor with the result ?
Sorry I am very new to this