Here is my sensors.yaml which gives error can you please check what is wrong?
- platform: qnap
host: 10.0.1.10
port: 443
ssl: true
verify_ssl: false
username: xxxx
password: xxxx
monitored_conditions:
- status
- system_temp
- cpu_usage
- cpu_temp
- memory_percent_used
- memory_free
- memory_used
- volume_percentage_used
- drive_smart_status
- volume_size_free
- network_tx
- network_rx
- drive_temp
- platform: radarr_upcoming_media
host: 10.0.1.10
port: 7878
api_key: xxxx
max: 10
- platform: sonarr_upcoming_media
api_key: xxxx
host: 10.0.1.10
port: 8989
days: 7
ssl: false
max: 10
- platform: afvalinfo
resources:
- gft
- pbd
- papier
- restafval
- trash_type_today
- trash_type_tomorrow
location: xxxx
postcode: xxxx
streetnumber: xx
streetnumbersuffix: ""
dateformat: "%d-%m-%Y"
locale: "nl"
timespanindays: 365
- platform: template
sensors:
paper_days_until_collection:
value_template: "{{ state_attr('sensor.afvalinfo_papier', 'days_until_collection_date') }}"
- platform: template
sensors:
afvalinfo_next_trash_type_and_date:
value_template: >
{% set ns = namespace(minimum=365) %}
{% set list = ['gft', 'papier', 'pbd', 'restafval','textiel'] %}
{%- for l in list %}
{%- set days = state_attr('sensor.afvalinfo_' ~l, 'days_until_collection_date')%}
{%- if days != None and days < ns.minimum %}
{%- set ns.minimum = days %}
{%- endif %}
{%- endfor %}
{%- for l in list %}
{%- set days = state_attr('sensor.afvalinfo_' ~l, 'days_until_collection_date')%}
{%- if days == ns.minimum %}
{{l}} · {{ states('sensor.afvalinfo_' ~l) }}
{%- endif %}
{%- endfor %}
- platform: template
sensors:
- name: "Living Room Time to Temp"
unique_id: living_room_time_to_temp
icon: mdi:camera-timer
unit_of_measurement: 'minutes'
state: "{{ ((state_attr('climate.woonkamer','temperature')|float(0) - states('sensor.woonkamer_temperature')|float(0)) * state_attr('sensor.woonkamer_time_to_temp','rate_of_change')|float(0)/60)|abs|int }}"
attributes:
message: |
{% if states('sensor.woonkamer_time_to_temp')|float(0) < 10 %}
IN LESS THAN 10 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 16 %}
IN 15 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 21 %}
IN 20 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 26 %}
IN 25 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 31 %}
IN 30 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 36 %}
IN 35 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 41 %}
IN 40 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 46 %}
IN 45 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 51 %}
IN 50 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 56 %}
IN 55 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 61 %}
IN 1 HR
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 66 %}
IN 1 HR 5 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 71 %}
IN 1 HR 10 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 76 %}
IN 1 HR 15 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 81 %}
IN 1 HR 20 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 86 %}
IN 1 HR 25 MIN
{% elif states('sensor.woonkamer_time_to_temp')|float(0) < 191 %}
IN 1½ HR
{% else %}
IN 2+ HR
{% endif %}
time_of_current_change_to_heating: >
{{ states('input_datetime.hvac_current_heat_started') }}
time_of_last_change_to_heating: >
{{ states('input_datetime.hvac_heat_started') }}
time_of_last_change_from_heating: >
{{ states('input_datetime.hvac_heat_ended') }}
elapsed_seconds: >
{{ as_timestamp(states('input_datetime.hvac_heat_ended')) - as_timestamp(states('input_datetime.hvac_heat_started')) }}
temp_at_last_change_to_heat: >
{{ states('input_number.hvac_heat_start_temp') }}
temp_at_last_change_from_heat: >
{{ states('input_number.hvac_heat_end_temp') }}
degrees_of_separation: >-
{{ (states('input_number.hvac_heat_end_temp')|float(0) - states('input_number.hvac_heat_start_temp')|float(0))|abs|round(1,"even",0) }}
rate_of_change: >
{% if state_attr('sensor.woonkamer_time_to_temp', 'degrees_of_separation')|float(0) > 0 %}
{{ state_attr('sensor.woonkamer_time_to_temp', 'elapsed_seconds')|float(0) / state_attr('sensor.woonkamer_time_to_temp', 'degrees_of_separation')|float(0) }}
{% else %}
0
{% endif %}
current_temp: >
{{ states('sensor.woonkamer_temperature') }}
target_temp: >
{{ state_attr('climate.woonkamer','temperature') }}
last_estimated_time_to_temp: >
{{ ((state_attr('sensor.woonkamer_time_to_temp','temp_at_last_change_from_heat')|float(0) - state_attr('sensor.woonkamer_time_to_temp','temp_at_last_change_to_heat')|float(0)) * state_attr('sensor.woonkamer_time_to_temp','rate_of_change')|float(0))|abs|timestamp_custom('%H:%M:%S', true) }}
- name: "Nest Heating Runtime"
unique_id: nest_heat_runtime
unit_of_measurement: 'seconds'
state: "{{state_attr('climate.woonkamer','elapsed_seconds')|float(0) }}"
- name: "Nest ECO Low"
unique_id: nest_eco_low
device_class: temperature
unit_of_measurement: '°C'
state: '19.5'
- name: "Nest ECO High"
unique_id: nest_eco_high
device_class: temperature
unit_of_measurement: '°C'
state: '24.5'
- name: "Nest ECO Temp"
unique_id: nest_eco_temp
state: >
{% if states('sensor.nest_eco_low') < states('sensor.nest_setpoint') < states('sensor.nest_eco_high') %} none
{% else %} eco
{% endif %}
- name: "Nest Humidity"
unique_id: nest_humidity
device_class: humidity
unit_of_measurement: '%'
state: "{{ states('sensor.woonkamer_humidity')|round(0,'even',0) }}"
- name: "Nest HVAC Action"
unique_id: nest_hvac_action
state: "{{ state_attr('climate.woonkamer','hvac_action') }}"
- name: "Nest HVAC Mode"
unique_id: nest_hvac_mode
state: "{{ states('climate.woonkamer') }}"
attributes:
hvac_off: "{% if (states('climate.woonkamer') == 'off') %} ✔ {% else %} {% endif %}"
hvac_heat: "{% if (states('climate.woonkamer') == 'heat') %} ✔ {% else %} {% endif %}"
hvac_cool: "{% if (states('climate.woonkamer') == 'cool') %} ✔ {% else %} {% endif %}"
hvac_auto: "{% if (states('climate.woonkamer') == 'auto') %} ✔ {% else %} {% endif %}"
- name: "Nest Preset Mode"
unique_id: nest_preset_mode
state: "{{ state_attr('climate.woonkamer','preset_mode') }}"
attributes:
none: "{% if (state_attr('climate.woonkamer','preset_mode') == 'none') %} ✔ {% else %} {% endif %}"
eco: "{% if (state_attr('climate.woonkamer','preset_mode') == 'eco') %} ✔ {% else %} {% endif %}"
- name: "Nest Heating Rate of Change"
unique_id: nest_heating_rate_of_change
unit_of_measurement: 'seconds/degree'
state: "{{ state_attr('sensor.woonkamer_time_to_temp','rate_of_change')|float(0) }}"
- name: "Nest Setpoint"
unique_id: nest_setpoint
device_class: temperature
unit_of_measurement: '°C'
state: "{{ state_attr('climate.woonkamer', 'temperature') }}"
- name: "Nest Time to Temp Message"
unique_id: nest_time_to_temp_message
state: >
{% if state_attr('climate.woonkamer','hvac_action') == 'off' %} SYSTEM IS OFF
{% elif state_attr('climate.woonkamer','hvac_action') == 'idle' and states('climate.woonkamer') == 'heat' %} HEAT SET TO
{% elif state_attr('climate.woonkamer','hvac_action') == 'idle' and states('climate.woonkamer') == 'cool' %} COOLING SET TO
{% else %} {{ state_attr('sensor.woonkamer_time_to_temp','message') }}
{% endif %}
attributes:
hvac_action: "{{ state_attr('climate.woonkamer','hvac_action') }}"
- name: "Nest Temperature"
unique_id: nest_temperature
device_class: temperature
unit_of_measurement: '°C'
state: "{{ state_attr('climate.woonkamer','current_temperature')|round(1, 'half', default=0) }}"
- name: "Nest Outside Temperature"
unique_id: nest_outside_temperature
device_class: temperature
unit_of_measurement: '°C'
state: "{{ (states('sensor.openweathermap_temperature')|float(0) + 0.5)|round(0,'floor',default=0) }}"