Skip to content

Template sensor change #4

@horbye

Description

@horbye

Since recent changes in HA, I got some errors in the log file
has device class 'None', state class 'None' unit 'State' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>) value

Removed this line, from each template sensor, solved it
unit_of_measurement: "State"

So they look like this:
sensor:

  • platform: template
    sensors:
    komfovent_on_off:
    friendly_name: "Komfovent On Off"
    value_template: >-
    {% set mapper = {
    '0' : 'Off',
    '1' : 'On'} %}
    {% set state = states('sensor.komfovent_on_off_num') %}
    {{ mapper[state] if state in mapper else 'Unknown' }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions