Thanks for getting the create-event service working a while back!
I was wondering if you knew if there was a way to ‘copy’ the functionality of the button in the sidebar calendar to my dashboard? I assume that button pops up a card with entry fields, then the event is created using the create_event service, but I didn’t really want to take a day or two of trial and error getting something like that working since it already exists, just on a different page…!
Ok thanks.
I was hoping the " + Add Event " button (in the calendar sidebar screen) might call a service/script that opens the pop-up, so I could link it to another button on another dashboard. It sounds like the button’s action might not work the same way as a button element though.
I still don’t understand the big picture of what you are trying to accomplish, nor the specifics of what you are asking. But if you want to make a custom card to call websocket APIs, that is a thing that exists.
Thanks for persisting with me!
The screenshot is from the calendar page in the sidebar/menu. It is the default HA calendar. I want a button on another page that opens an identical pop-up, but it sounds like I have to build it. I know I can use calendar.create_event to add the event, once I have the details available in the pop-up.
I’ll make a button to open my own form I’ll build to gather the necessary event information, like the default pop-up form does, then call calendar.create_event. I was just looking for shortcuts
For others in the same boat as @mattat - here’s some yaml for a create calendar form. You’ll need to create the input fields. I use the o365 plugin (i know it’s recently been split apart, I must update) but this is what i’m doing with button-card & browser_mod. Note - I had this in a popup but it caused issue with the date pickers.
@iamdabe, thanks for posting. I’d managed to come up with a form that looks very much like yours, but you saved me some script writing time , but I also had a dropdown to select the calendar to add it to (which I couldn’t add an entity to so need to hard code the options->entity map.
Is your New Event card simply a card on a dashboard? I had started building mine as a pop-up using browser_mod.popup, but found that the popup was replaced with the date selector, and then didn’t come back [EDIT: oh, just saw your releated comment] (I’ve only tested it in the browser mod menu section, not on a real dashboard, so maybe it will work in productions., but probably not)… so I was thinking of different ways to select the date. Clicking on a calendar day (as the crate event button) was one approach, but I’d be limited to days currently on my view… [EDIT 2: just looked into an expanding section to hide the form until the crete event buttoin is pressed. I haven’t read the details, but if I can expand it programatically it may be what I’m looking for!]
Thanks for your input. It is great to see someone has the essential functions working!
Hi, thanks for the code. I was in the same boat as you too!
Could you also help me create the input fields? can I do it from config.yaml? Do they have to have any particular requirements? Thanks
so am i right in thinking that there’s no way to add a “add event” button to a calendar in a card that is being displayed on a dashboard? I’m trying to make an intuitive system that my wife will engage with and if she has to go off onto different screens etc, i think it just won’t happen.
Hi all - Need help please. I’m getting this error when testing the script - Error in describing action: Cannot read properties of undefined (reading ‘create_event’). What am I missing please? -
Error running action
Action o365.create_event not found
Oh happy days! This has been automatically added, I think as a feature in 2026.2. I use the regular calendar card with my google calendars, and noticed an “Add Event” button (“Legg til hendelse” in norwegean) today on the card today. Shows a dialogue popup with the usual fields, works great. Also, It seems I can also delete, but not edit, events.