Lovelace: Advanced calendar card

GaryK Can you remove all your calendars and add it one by one? Any errors in console (F12)? The problem here is that Home Assistant is giving me the config as it is read by HA, and I can’t do anything with it inside component. I just get entities and options. And thank you for your feedback:) Probably the most difficult thing in programming is to find bugs.

finity Thanks! I didn’t have a tracker before, I’ll add it now, but I don’t use it yet, I will test it later)

Did you already change maxResults in google.py as described at the bottom of the page linked below so that more than 5 events are available to this calendar card component?

Not Found:

core-ssh:/config/custom_components/calendar# wget https://raw.githubusercontent.com/home-assistant/home-assistant/dev/homeassistant/components/calendar/google.py Connecting to raw.githubusercontent.com (151.101.24.133:443)
wget: server returned error: HTTP/1.1 404 Not Found

It’s not working anymore, because the source was moved to components/google/calendar.py (or it was a mistake in this ljmerza repo, or rdehuyss which I think was the original one).
I have 7 events by default. So, GaryK, if you have 14 days set, it will only show 5 or 7 nearest events anyway. I will write in Readme about it. It’s one of my next things to do.

I’m on HA 0.87.1 and modifying maxResults in the google.py below works for me.

Google.py

1 Like

OK. I removed all calenders, got the “The calendar cannot be loaded from the Home Assistant component.” message. Next I added a calendar directly under entities:

      `- entity: calendar.holidays_in_united_states`

Refreshed the browser, and still got the cannot load message. I then removed the line above and added:

        `entity: calendar.kelleycalendar`

back to its original position. Refreshed UI and got the no events message. So, I added the holiday calendar back directly under entities and refreshed. Today’s holiday appeared. No errors were generated at (F12).

Yes it works. I mean the link before was incorrect. It’s working with your link.

My configuration works in different ways:

  • entities:
    • entity: calendar.kalendarz_dom
    • entity: calendar.kalendarz_test
    • calendar.kalendarz_swieta
    • entity: calendar.wojtek
      showColors: true
      maxDaysToShow: 7
      showLocation: true
      showMonth: false
      showCurrentEventLine: false
      type: “custom:atomic-calendar”
      title: “Kalendarz”

or

  - type: "custom:atomic-calendar"
    title: "Kalendarz"
    entities:
    - entity: calendar.kalendarz_dom
    - entity: calendar.kalendarz_test
    - calendar.kalendarz_swieta
    - entity: calendar.wojtek
    showColors: true
    maxDaysToShow: 7

I will try with other possibilities tomorrow, and try to find what’s happening, but like I said I think I can’t do anything with entities, I just get them from HA.I’ll add some error logs.

1 Like

Does google.py @ /custom_components/calendar/ affect this card? If it does, then do additional events result in additional days searched? The test is to schedule an event 10 days out, configure the calendar for 14 days and have it appear on the card.

It will show maxDays, but no more than maximum events in google.py. It shoud do it at least, I didn’t try, too many things I’ve done last days to check everything :). Google API allows to get 100 events. I’ll try to do something tomorrow, it’s too late now :slight_smile: Or you could test it if your calendars are working now…

OK. I’ll drop google.py into custom_components/calendar and make the edit. You need your rest :grinning:, thanks! We can wait until tomorrow.

Change made:

DEFAULT_GOOGLE_SEARCH_PARAMS = {
    'orderBy': 'startTime',
    'maxResults': 10,
    'singleEvents': True,
}

Yes that’s what I have in the file located here (on Hassio):

/config/custom_components/calendar/google.py

After reboot, is it working?

@atomic77,

I have now started converting my calendars over to your new advanced calendar card. Really love the versatility of it. I use transparent cards and really like how I was able to get the best look by change the font colors along with using card-modder to make the background transparent and round the corners of the calendar.

I did run into an issue that I wanted to ask you about. On my main status view that I use on all my wall mounted displays, I have one calendar on the left side of the screen that shows appointments and on the right side of the screen I have a deliveries calendar that is automatically generated from when UPS, USPS, Fedex, etc… sends me a shipping email notification. So that calendar shows me like the next 5 shipments that I will be receiving over the next 7 days.

It doesn’t appear like I can have more than one of the custom:atomic-calendars on the screen at the same time like I was able to do with the other calendar cards. It isn’t really practical for me to mix my deliveries calendar and appointments calendar onto one single calendar card.

Do you know if having only one calendar on the screen at a time will be an ongoing limitation of this card? Thanks!

Edit:
I just now realized that the issue is not just limited to one screen. If I have one calendar on one view and a second calendar on another view, one of the calendars will not display until you refresh the screen. Then if you go look at the other view for the other calendar, it is gone until you refresh the screen.

I don’t want to derail this thread but I would be interested in how you did that. A link or something would be ok.

Create a google calendar for this such as a Deliveries calendar. Set up your gmail filter to auto forward those emails from UPS, USPS and Fedex with an expected delivery date to the Zapier Email Parser.

Within Zapier Email Parser, highlight where the shipping arrival date is on the forwarded emails for each of the shipping providers thus creating a template.

Then create a zap within Zapier to create a google calendar entry for the expected delivery date in the email for each shipping email you get. From that point forward, every time you receive an email with an expected shipment arrival date, a calendar entry will be auto created for that arrival date. No fee for me to use zapier and zapier email parser in this way.

Important tip. Gmails that are forwarded manually have a lot of extraneous info at the top of the email that isn’t there when gmail auto forwards using a filter. When training zapier email parser, you want to train it with an email that will look like what gets auto forwarded. So remove that extra forwarding information before manually forwarding the first email when first creating the template.

image

2 Likes

No change following restart. No month displayed, and with maxDaysToShow set to 14, events more than seven days out don’t appear. I have three calendars configured, all seem to work correctly.

I’ve noticed I need to refresh the browser to see the calendar card after initial loading or UI edits. Also, the title and content are absent when editing the card with the UI editor. Lovelace issue?

Thanks for the info. I’ll look into that.

  • Small update, rendering / refreshing should be better.
  • Displaying more than one is working in my ‘development’ version, but is broken in ‘production’ with code minimize turned on. It’s some error related to webpack/babel so I think it’s not my fault, now I will look at it, try to move to rollup (I’m looking at another card source - mini-graph-card and trying to understand why this is happening)
  • The google.py / more events is lower on my list, because it’s completely not related to my code, I will look later.
  • Lovelace UI configuration works for me now, and the file is smaller

Edit: Fixed the errors with multiple cards, v0.6.3

1 Like

Works great, thank you!

I noticed a minor typo in your tracker.json that gives the wrong url when using the link on the tracker-card. See “hhttps” on the visit_repo line:

{
    "atomic-calendar": {
      "updated_at": "2019-02-19",
      "version": "0.6.3",
      "remote_location": "https://github.com/atomic7777/atomic_calendar/releases/download/v0.6.3/atomic-calendar.js",
      "visit_repo": "hhttps://github.com/atomic7777/atomic_calendar",
      "changelog": "https://github.com/atomic7777/atomic_calendar/releases/latest"
    }
}