For my first template attempt, I want to access the attribute of a sensor, so I can graph the flow rate setpoint of my Vaillant heat pump.
I have the Home Assistant integration working fine and I can see the value I want in the ‘states’ view:
Sensor: [sensor.my_home_circuit_0_state]
Attribute: [heating_circuit_flow_setpoint: 27.241627]
No matter what I try, I always get back to the same error:
Sensor None has device class 'temperature', state class 'measurement' unit '°C' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'template: - sensor: - name: "my_home_circuit_0_temperature" state: 27.241627' (<class 'str'>)
Thank you so much! I had read that error 20 times, and completely missed the quote! I have corrected my formatting, you are correct that the fancy quote was an artifact.
I tried your replace option, but found that the editor flagged an error, I think it did not like the triple quotes:
Note that if you use the GUI to create a sensor helper, you should only provide the template (without surrounding quotes for a one line template) for the State template* field.
Don’t put YAML code in there, the YAML code is only used when adding a sensor in configuration.yaml (either directly or through includes/packages)
Which would also fix the triple single quote issue if you then use double quotes in the template. The triple single quote is probably being interpreted as an escaped quote as you escape single quotes with another single quote in yaml.