Is it also possible to get only the time ,so without the date and the +01:00
Hi Frank, Iâm assuming you are asking this because you want to show something pretty on your dashboard. My take on this:

For the âMorgen 06:50â string, I use this template sensor called sensor.moment_nextup_lesson_magister (to add to your dashboard):
template:
- trigger:
- platform: state
entity_id: sensor.date
- platform: state
entity_id: sensor.nextup_lesson_magister
- platform: state
entity_id: input_number.magister_offset
sensor:
- name: Moment nextup lesson Magister
unique_id: moment_nextup_lesson_magister
state: >-
{% set midnight = now().replace(hour=0, minute=0, second=0, microsecond=0).timestamp() %}
{% set event = states('sensor.nextup_lesson_magister') | as_timestamp(default=0) %}
{% set delta = ((event - midnight) / 86400) | int %}
{% if is_state('sensor.nextup_lesson_magister','') %} Onbekend
{% elif delta < 0 %} Onbekend
{% elif delta == 0 %} Vandaag {{ (states('sensor.nextup_lesson_magister')|as_timestamp(default=0) - (states('input_number.magister_offset')|int(default=90) * 60)) |timestamp_custom('%H:%M', true)}}
{% elif delta == 1 %} Morgen {{ (states('sensor.nextup_lesson_magister')|as_timestamp(default=0) -(states('input_number.magister_offset')|int(default=90) * 60)) |timestamp_custom('%H:%M', true)}}
{% else %} Over {{ delta }} dagen {{ (states('sensor.nextup_lesson_magister')|as_timestamp(default=0) - (states('input_number.magister_offset')|int(default=90) * 60)) |timestamp_custom('%H:%M', true)}}
{% endif %}
For your specific question, the template is shown in the last line, check the timestamp_custom.
ok thanks
even in het nederlands maar klopt het als ik dit allemaal opnieuw in mijn template.yaml zet dat ik dan ook even moet wachten voordat ik ook werkelijk de tijden zie? natuurlijk heb ik wel mijn yaml geherladen
If you copy exactly my yaml, you can trigger an update by changing the offset.
ok thanks
i have now seen what was going wrong , the ical intergration name the sensors ical_ical_magister, so i have change that and now its is working
thanks
I have clicked on each and every link within the Magister web app, but I canât find any iCal link. I guess that means calendar sharing is disabled by the school?
Hoi Bart ,
Bij je onder je eigen naam ingelogd of 1 van je kinderen want je moet bij het account kijken van wie magister is anders zie je het kopje agenda delen niet
Aha, ik was als mezelf ingelogdâŚ
I love this with two kids who can never get out of bed ![]()
Iâm stuck at triggering the alarm. The automations runs on the right time but never gets past the second condition.
What am i doing wrong?
Hello @efraim, there seems to be nothing wrong with the template. I think you should check out the different elements of the template in Developer Tools > Templates. Copy and paste this and check if it produces expected values:
{{ states('sensor.nextup_lesson_magister_pien') }}
{{ states('input_number.magister_offset_pien') }}
{{ states('sensor.date') }}
One thing that comes to mind: do you have the Time & Date integration configured?
@Emphyrio Thanks, iâm not sure how to do this. if i parse this i get an error?:

If i look at the values of the sensors all seems ok? (and date/time integration configured)

@Emphyrio First of all, thank you for your efforts in this project. Most steps are fullfilled in my setup after following your instuctions, although I donât fully comprehend everything I did. All prerequisites are filled; and sensors for 50 ical_magister_events are visible in Dev. tools states. However, not all seems to work as it should.
I need some help with your step âCreate a template sensor that contains the date and time for the next âfirst lesson of the dayâ.â In this sensor I assume you can determine the actual first lesson the next school day. But how do you create/edit this template sensor? What I did was create a new template sensor helper for it but where do I put the first line of the code? Or should I manually put this code in configuration.yaml? Thanks in advance
I got it working, after creating a templates.yaml with your code and including it in config. Works great, thanks a lot!
One remark to the second step in your instructions:
Install the iCal Sensor add-on through HACS. Follow the instructions to add it to your integrations. Configure it to look a maximum of 14 days into the future and for 50 events (=50 sensors). Name it âical_magisterâ to make it work with the following templates.
I recommend to name the calendar just âmagisterâ (rather than âical_magisterâ in your instructions) or the sensors will be named âsensor.ical_ical_magister_event_xâ
@ChielB Thanks for sharing. I changed the starting post with your suggestion, âmagisterâ instead of âical_magisterâ.
My Home Assistant configuration is indeed old school, everything is in YAML. This alarm clock should probably be a blueprint now. Perhaps if I find some spare time I could check that out.
I made a mistake with the template formatting in my previous post, my apologies. Fixed it in the post. But I donât see anything wrong with the pieces of info you posted. Perhaps check out your log?
Also you can fake trigger the alarm for testing purposes. In Developer Tools > States > find sensor.ical_magister_pien_event_0 > click on it > at the top of the screen change the attribute âstartâ.
@Emphyrio When / how often does the âsensor.description_of_next_up_lessonâ update? My kidâs first lesson was dropped today in Magister but obviously the alarm was still running at the original scheduled time. Is there a way to update this manually or maybe even make an automation for this sensor (and thus the alarm) to update? In case there is a temporary change in the schedule the alarm automation adapts accordingly? Furthermore, this works like a charm. Thanks!
Hi @ChielB, the sensors should update with any change in the state of the âical_magisterâ sensors. So the alarm should have adjusted when the lesson was dropped. Perhaps the lesson was dropped from Magister after the alarm time? Also, there is a sync delay so it takes a little time for Home Assistant to pick up the change after the âroster makerâ (is that a word?) drops the lesson from Magister.
(The alarm actually triggers on sensor.nextup_lesson_magister, not on sensor.description_of_nextup_lesson. But the same update mechanism applies to both sensors).
Thanks for the prompt reply @Emphyrio. The dropped first lesson was visible in Magister prior to the alarm time - I manually disabled the alarm to minimise the expected teenager morning mood ![]()
I wonder what the normal sync delay is then, is there anything to say about that?
What I did was manually reload some YAML configuration in Developer Tools, like âinput date timesâ and âtemplate entitiesâ and after that the amended alarm showed. Not sure what activated that, but I figured I might automate that refresh prior to the set alarm?
Letâs make roster-maker an official term here! ![]()
I found the iCal integration syncs every 2 minutes. Should be fairly quick. I donât know why you needed to reload stuff.
Hey everyone,
This is probably my first real interaction here in many, many years. I love this stuff! I had been hoping to create something similar myself, taking plenty of detours along the wayâthen I stumbled upon this post!
Iâve been tweaking it for about 20 hours in total (not in a single stretch) to get it working the way I envisioned.
Iâm using all the settings you mentioned and sharedâthough I doubled everything since two kids here are using Magister. I simply added _name and _name2 to everything you provided.
Anyway, does anyone hereâwhether itâs you or another helpful readerâhave this configured to display more entity attribute as well, particularly for the events for the entire current or upcoming day?
Iâm not sure if this varies by school, but when I imported my stepchildrenâs iCals following your steps, I could see the time and well the title ir name of the ical entity (which pretty much sums up : teacher, what class it is, time and date) The teachers seem to be very explicit in their instructions (e.g., âBring your pen,â âDonât forget your homework,â etc.), but they also include important details.
Some of the important stuff is in the ical_event attributes .
Has anyone set this up successfully while managing multiple Magister accounts for multiple children? Have you been able to extract extra attributes from each event? Or do you just have something cool to share about how youâre using this integration?
Iâd love to hear your experiences!
Thanks!
Hey @Nuffsaid86, nice to hear you are enjoying it. For multiple children, you can repeat the steps making sure you use unique entity names.
My kids just use the Magister app to check their calendar and homework. But if you wanted, you could probably display the calendars on a Home Assistant dashboard.
