I have 3 different types of calendars in my google calendar. 1st is my rugby teams fixtures, School Holidays and parents holidays.
1st question. Before Coronavirus and league season was running and fixtures appeared. Since fixtures have now been removed, all I get is Unknown. Is there a way to get blank rather than unknown.
2nd question. My other calendar is telling me when the next school holidays are. Today was meant to be the 1st day since breakup but its still showing me the event. Should this not change to the next event after expirey of first date ?
The google calendar sensors states are simply ‘on’ or ‘off’ normally. It’s ‘on’ if the event is happening right now. Else, it’s off.
Otherwise, it has a bunch of attributes about the next events. And if there are no further events, there are no useful attributes (hence ‘unknown’)
The only way to change that would be to create a template sensor for each calendar and track that one in lovelace instead. But, you’ll have to manually copy all of the attributes yourself for each calendar. This will get quite annoying.
# Example configuration.yaml entry
sensor:
- platform: template
sensors:
rugby_calendar:
friendly_name: "Rugby Calendar"
value_template: "{{ states('calendar.my_rugby_calendar')}}"
attribute_templates:
start_time: >
{% set a = state_attr('calendar.my_rugby_calendar', 'start_time') %}
{{ a if a != 'unknown' else "" }}
end_time: >
{% set a = state_attr('calendar.my_rugby_calendar', 'end_time') %}
{{ a if a != 'unknown' else "" }}
# And so on for all attributes
Or, just modify the integration to put in dummy values for those attributes if they don’t exist.
As for your 2nd one showing an old event, I’m not sure about that one. Have you not reboot HA since then? It’s possible the last event just gets stuck there, but it should be gone by next reboot I would think!