I’m struggling to locate the error in my configuration syntax. I’m attempting to add two sensors that make up my 1st Floor HVAC system wattage & multiply them by .001 to get a state in kWh for the energy monitor to use.
- platform: template
sensors:
1st_fl_hvac_kwh:
friendly_name: "1st Floor HVAC Power Usage"
unit_of_measurement: 'kWh'
device_class: power
value_template: “{{ (states(‘sensor.1st_floor_condenser_watts’)|float + states(‘sensor.1st_floor_furnace_watts’)|float) * .001 }}”
I keep receiving a configuration error when validating:
Could someone explain the configuration error message while also pointing out my error?
francisp
(Francis)
May 18, 2020, 6:50pm
2
- platform: template
sensors:
1st_fl_hvac_kwh:
friendly_name: "1st Floor HVAC Power Usage"
unit_of_measurement: 'kWh'
device_class: power
value_template: “{{ ((states('sensor.1st_floor_condenser_watts')|float ) + (states('sensor.1st_floor_furnace_watts') |float) ) * .001 }}”
Thank you for the suggestion. I see that you added a second set of () into the value template. I copied this edited line into my configuration but I’m still receiving the following error.
Hellis81
(Hellis81)
May 18, 2020, 7:11pm
4
It says "unexpected .
"
I assume that is the .001 that should be 0.001
1 Like
SOLVED
Besides the missing () pointed out above, the “* .001” was causing the error. I changed it to “/ 1000” and the syntax error went away.
Would love a post-mortem input as to why this is an issue if anybody could provide details.
- platform: template
sensors:
1st_fl_hvac_kwh:
friendly_name: "1st Floor HVAC Power Usage"
unit_of_measurement: 'kWh'
device_class: power
value_template: “{{ ((states('sensor.1st_floor_condenser_watts')|float ) + (states('sensor.1st_floor_furnace_watts') |float)) / 1000 }}”
Cheers!
Thanks! So it would work as “* 0.001” or “/ 1000”
Don’t know why I didn’t see that before.
Hellis81
(Hellis81)
May 18, 2020, 7:33pm
7
Probably…
But my first reaction to your * 0.001 was why not /1000 but sure whatever floats your boat