#yeah ```state class measurement```
1 messages · Page 1 of 1 (latest)
Cannot quick reload all YAML configurations because the configuration is not valid: Invalid config for [sensor.template]: [state_class] is an invalid option for [sensor.template]. Check: sensor.template->sensors->temp_heater_bedroom->state_class. (See ?, line ?).
i get the error
Please use a code share site to share code or logs, for example:
- https://dpaste.org/ (select YAML for the language, and consider picking a longer expiry)
- http://pastie.org/ (select YAML for the language)
- https://paste.debian.net/ (you guessed it, select YAML as the language)
Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.
when i add state_class: measurement
Yeah use dpaste and give us your code please
You need to use a new style template sensor
sensors:
temp_heater_bedroom:
unique_id: temp_heater_bedroom
unit_of_measurement: "°C"
state_class: measurement
value_template: "{{ states.climate.heater_bedroom.attributes.current_temperature }}"
@spark shuttle To format your text as code, enter three backticks on the first line, press Shift+Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
That's the old style, it doesn't support ... many things
It's just unfortunate that lots of examples exist of the old way
template:
- sensor:
- name: "temp_heater_bedroom"
unique_id: temp_heater_bedroom
unit_of_measurement: "°C"
state_class: measurement
state: "{{ state_attr('climate.heater_bedroom','current_temperature') }}"
I do not really see the difference
If you've got the code under a sensor.yaml include you'll need to move it too
Yeah using templates for sensors vs making sensors under templates
It's a subtle but very important diff
The old way lacks many features because it's no longer maintained
dont want that. So i just make a template.yaml file and link it in the main config file?
Hei, so now i have the same functionality, just that its moved into template.yaml
but still no temp on the area card
Is it a card that's automatically including stuff marked for that area?
Yeah
And the sensor is still in the correct area after re-creating it?
Yes, i just doubled checked. I have also restarted HA
Data is flowing nicely
Just doesnt get there. Its like it does not register it as a temp measuring device