I want to display the workshifts of my wife in my HA dashboard. My primary information tells my which shift she have today (morning-, late-, nightshift). But I can’t figure out how to display tomorrows calendar event.
I probably made it very difficultly because I can’t really code so if todays event has a specific word in it (morningshift, Lateshift, and so on), on of four toggle helper switch to on, three of four switch to off. In my mind I wanted to archive the same with tomorrow’s event.
Can someone please help or have a better idea how to do this?
You will need to provide some details about how the calendar is being used.
For example, does the calendar include other events that are not work shifts that will need to be ignored? If yes, what details exist that would allow us to select work shifts. Is the shift type held in the title or description of the calendar event? Is the type held by itself or is there other data that needs to be removed?
The easiest way to give us all the useful information is to use the Services tool to call the following (make sure to use your calendar’s id):
The calendar only contains her shifts (Morning-, late, Nightshift and free). I made a dedicated local calendar just for this purpose. The shifts name is only displayed in the Title of the event.
You can’t test that example in the Template Editor. The agenda variable is defined by the execution of the calendar.list_events service call but the Template Editor cannot execute service calls.
To clarify, did you try to test the template in the Template editor tool (which @123 addressed above) or are you saying the entity’s state is “unknown” in the States tool? If you are talking about the States tool, make sure to load the template by Restarting Home Assistant.
Hello guys, I’m trying to use this template but I get this error in my log: Error rendering state template for sensor.test_calendario: UndefinedError: No first item, sequence was empty