-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi,
according to HA release notes, the old platform template syntax for sensors is deprecated and will be removed in HA 2026.6, the templates should look like this:
template:
- sensor:
- name: "Freifunk Router Online Status"
unique_id: mein_freifunk_router_online
icon: >
{% if states('sensor.mein_freifunk_router_online') == 'online' %}
mdi:router-wireless
{% else %}
mdi:router-wireless-off
{% endif %}
state: >
{% set my_router = state_attr('sensor.freifunk_mein_router_daten', 'nodes')[0] | default({}) %}
{% if my_router and my_router.status == 'online' %}
online
{% else %}
offline
{% endif %}
- name: "Freifunk Router Clients"
unique_id: mein_freifunk_router_clients
unit_of_measurement: "Clients"
icon: mdi:account-group
state: >
{% set my_router = state_attr('sensor.freifunk_mein_router_daten', 'nodes')[0] | default({}) %}
{{ my_router.clients if my_router and my_router.clients is defined else 0 }}
- name: "Mein Freifunk Router Last (LoadAvg)"
unique_id: mein_freifunk_router_loadavg
icon: mdi:cpu-32-bit
state: >
{% set my_router = state_attr('sensor.freifunk_mein_router_daten', 'nodes')[0] | default({}) %}
{{ my_router.loadavg if my_router and my_router.loadavg is defined else 0.0 }}
- name: "Freifunk Router Firmware"
unique_id: mein_freifunk_router_firmware
icon: mdi:chip
state: >
{% set my_router = state_attr('sensor.freifunk_mein_router_daten', 'nodes')[0] | default({}) %}
{{ my_router.firmware if my_router and my_router.firmware is defined else 'Unbekannt' }}
- name: "Freifunk Router Letzter Kontakt"
unique_id: mein_freifunk_router_letzter_kontakt
device_class: timestamp
icon: mdi:clock-time-four-outline
state: >
{% set my_router = state_attr('sensor.freifunk_mein_router_daten', 'nodes')[0] | default({}) %}
{{ my_router.lastcontact if my_router and my_router.lastcontact is defined else None }}
Metadata
Metadata
Assignees
Labels
No labels