because of some higher required log level this afternoon, I see:
Sensor sensor.marijn_location_picture has device class None, state class None and unit Marijn thus indicating it has a numeric value; however, it has the non-numeric value: home (<class 'str'>)
now, which is probably there for some time, but want noticed before.
I have no idea why HA thinks it should expect a numeric value.
template:
- sensor:
- unique_id: marijn_location_picture
unit_of_measurement: Marijn
<<: &location_pic
name: >
{% set id = this.attributes.get('id') %}
{{states('person.' ~ id)|title|replace('_',' ')}}
state: >
{% set id = this.attributes.get('id') %}
{% set state = states('person.' ~ id) %}
{{state|slugify}}
picture: >
{% set id = this.attributes.get('id') %}
{% set state = states('person.' ~ id) %}
{% if state in ['home','not_home'] %}
/local/family/{{id}}_{{state|slugify}}.png
{% else %}
{{states('sensor.' ~ id ~ '_overlay_image')}}
{% endif %}
and customized the id with:
homeassistant:
customize:
sensor.marijn_location_picture:
id: marijn
would appreciate a suggestion here, is this a bug in HA, a user error, or?
only thing I could think of is the
unit_of_measurement: Marijn
which I use for the sake of displaying that with a badge bar below it, is seen as a number. should I maybe quote that?
there is another odd one:
- unique_id: wind_compass
state: >
{{states('sensor.buienradar_wind_direction_azimuth')}}
name: >
{{states('sensor.wind_compass_abbreviation')}}
unit_of_measurement: °
picture: >
{%- set degrees = states('sensor.buienradar_wind_direction_azimuth')|float(0) %}
{%- set path = '/local/weather/wind_compass/' %}
{%- set ext = '.png' %}
{%- set num = ((degrees // 11.25) * 11.25 // 1)|int %}
{%- set num = 0 if num == 360 else num %}
{{'{}{}{}'.format(path,num,ext)}}
also complaining it has no classes set.
Sensor sensor.wind_compass has device class None, state class None and unit ° thus indicating it has a numeric value; however, it has the non-numeric value: unknown (<class 'str'>);
cant we have numeric entities without setting a class? or , rephrase, shouldnt we?