Guten Morgen,
nach einer guten Nacht ist mir dann noch eine schöne Variante eingefallen und ist wahrscheinlich die schönste 
- Statistik mit Counter direkt aus den Sensoren
Wehrmutstropfen, der Counter wird erst erhöht wenn er vom Status "unavailable" zu einem anderen wechselt
Hier mal für alle TAG/WOCHE/MONAT/JAHR
#
# Shelly Offline Status am Tag (Counter in 24h)
#
# dieser zaehlt erst wenn er aus diesem Status wieder unavailable wechselt in einen anderen
#
- platform: history_stats
name: "switch.toaster_splugs_130 OFFLINE TAG"
entity_id: switch.toaster_splugs_130
state: "unavailable"
type: count
start: "{{ now().replace(hour=0, minute=0) }}"
duration:
hours: 24
#
- platform: history_stats
name: "switch.toaster_splugs_130 OFFLINE WOCHE"
entity_id: switch.toaster_splugs_130
state: "unavailable"
type: count
start: "{{ as_timestamp( now().replace(hour=0, minute=0, second=0, microsecond=0) ) - now().weekday() * 86400 }}"
end: "{{ now() }}"
#
- platform: history_stats
name: "switch.toaster_splugs_130 OFFLINE MONAT"
entity_id: switch.toaster_splugs_130
state: "unavailable"
type: count
start: "{{ now().replace(day=1, hour=0, minute=0, second=0, microsecond=0 ) }}"
end: "{{ now() }}"
#
- platform: history_stats
name: "switch.toaster_splugs_130 OFFLINE JAHR"
entity_id: switch.toaster_splugs_130
state: "unavailable"
type: count
start: "{{ now().replace(month=1, day=1, hour=0, minute=0, second=0, microsecond=0) }}"
end: "{{ now() }}"
Alles anzeigen
Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.
Viele Wege führen nach Rom 
Gruß und viel Spaß noch
Andreas