Family calendar

Here’s a use case that was probably never imagined. I’ve set this up for a quick history glance at my daily medications. An automation logs a calendar event when daily meds are taken/not taken and this is the result. I can think of lots of things where you might want a daily sucess/failure view and this is a nice option. I’m sure there are other ways, but this was relatively simple.

type: custom:week-planner-card
calendars:
  - entity: calendar.yourname_medication_log
    color: none
    name: " "
days: "14"
startingDay: today
startingDayOffset: "-13"
noCardBackground: false
compact: true
showTitle: true
texts:
  noEvents: ❓
  fullDay: null
  yesterday: null
  tomorrow: null
  monday: null
  tuesday: null
  wednesday: null
  thursday: null
  friday: null
  saturday: null
  sunday: null
  today: null
replaceTitleText:
  Medication Taken: ✅
  Medication Not Taken: ❌
columns:
  extraLarge: "7"
  large: "7"
  medium: "7"
  small: "7"
  extraSmall: "7"
title: History
grid_options:
  columns: full
showNavigation: true
card_mod:
  style: |
    .event[data-summary="✅"] {
      background-color: transparent !important;
      font-size: 24px !important;
      justify-content: center !important;
      text-align: center !important;
    }
    .event[data-summary="❌"] {
      background-color: transparent !important;
      font-size: 24px !important;
      justify-content: center !important;
      text-align: center !important;
    }
    .none {
      background-color: transparent !important;
      font-size: 24px !important;
      justify-content: center !important;
      text-align: center !important;
    }
    div.container {
      justify-content: center !important;
      text-align: center !important;
    }
    .day[data-date] {
      font-size: 20px !important;
      text-align: center !important;
      justify-content: center !important;
    }

2 Likes

Hi

I’ve been following a guide on here for creating a digital calendar.
I am new to HA (couple of weeks) but for the most part have it working.

I noticed there is a new feature to allow the navigation (back and forth) to different months when using week-planner-card mod

It reads as if you only need to set the attribute “showNavigation: true”
I’ve set this and it doesnt appear.

Here is an example from another members post:

Ive added “showNavigation: true” into my code but nothing appears:

Code is as follows:

card:
  type: custom:week-planner-card
  calendars:
    - entity: calendar.person
      name: Person
      color: "#2d7bcf"
      filter: ${ PERSONCAL }
    - entity: calendar.birthdays
      name: Birthdays
      color: red
      filter: ${ BIRCAL }
  days: ${ DAYS }
  startingDayOffset: 0
  hideWeekend: false
  noCardBackground: false
  compact: false
  locale: en
  showLocation: true
  hidePastEvents: false
  hideDaysWithoutEvents: false
  hideTodayWithoutEvents: false
  combineSimilarEvents: true
  showLegend: false
  legendToggle: false
  showNavigation: true
  texts:
    monday: Mon
    tuesday: Tue
    wednesday: Wed
    thursday: Thu
    friday: Fri
    saturday: Sat
    sunday: Sun
    yesterday: ""
    today: ⭐TODAY⭐
    tomorrow: ""

Any advice would be greatly appreciated because I cant figure out whats wrong with it.

Its something with the other cards you’re using in the stack, and or the layout. I think your “select view” button might even be cutting it off or hiding it. If I use this code, in a single card, I can toggle the navigation on and off as expected. There are only minor changes to this code from yours, just to get it to display.

type: custom:week-planner-card
calendars:
  - entity: calendar.person
    name: Person
    color: "#2d7bcf"
days: 7
startingDayOffset: 0
hideWeekend: false
noCardBackground: false
compact: false
locale: en
showLocation: true
hidePastEvents: false
hideDaysWithoutEvents: false
hideTodayWithoutEvents: false
combineSimilarEvents: true
showLegend: false
legendToggle: false
showNavigation: true
texts:
  monday: Mon
  tuesday: Tue
  wednesday: Wed
  thursday: Thu
  friday: Fri
  saturday: Sat
  sunday: Sun
  yesterday: ""
  today: ⭐TODAY⭐
  tomorrow: ""
grid_options:
  columns: full

Thanks SDH.

I too wondered if it was the select view, so I had removed that element temporarily and it still didnt appear.

I ran Dev tools in the browser, and the only error I could see was with the bubble-card mod.

I had recently updated to a newer version as it was stopping the “select view” element from working.

I rolled back, which then broke something else.
I upgraded from 1.12.0 week-planner-card to 1.12.1
Then rolled forward with the bubble-card mod again.

It then just appeared.

So im guessing something between the two mods was causing it to not display.
I’ve used some css with mod-card to make it display on the right hand side.
The arrows now just need better spacing, but suspect I need to do something with the spacing of the days and the remaining space left.

Would that be a fair summization?

This is the css that allows me to move the words and arrows around a bit:

        .container .navigation {
            position: absolute;
            right: 50px;
        }
        .container .navigation ul li {
            position: absolute;
            right: 65px;
            display: block;
            cursor: pointer;
        }

Happy with the progress so far though. Thanks for your support

I was on the idiot learning curve. I didnt need the “.container .navigation ul li”

Its now working properly. But I’m trying to figure out how to:

  1. Move the arrows and month to the right hand side
  2. Keep the calendar spaced down from the navigation
  3. Get the arrows vertically central to the month
  4. Add the last 2 digits of the year to the month

This would be really appreciated

This will move the “month” up. You can use the different margins to move items within their container. You should be able to do the same with the navigation, although I’m not certain of the object.

card_mod:
  style:
    .month{
       font-size: 80px !important;
       margin-bottom: 20px !important;
    }
1 Like

Thanks sdholden. I assumed the arrows and month were all considered “navigation” as they both became visible when I added ‘showNavigation’

I’ll give this a go now.

I also realised that the week-planner-card doesnt allow you to see months in their own entirity. Its always a rolling x-days (depending on whats defined).

Is there a way to change this? If not I might also experiment with atomic calendar as that appears to be possible.

Its definitely an interesting learning curve

Show entire month and only the month.

type: custom:week-planner-card
calendars:
  - entity: calendar.my_calendar_1
days: month
startingDay: month
1 Like

The margin and padding attributes didnt seem to work the way I wanted it to.
I ended up playing about with font sizes in both the navigation container and the month container.

navigation is font size 27 and month has a font size of 30
This seems to align them the best in my template

Thank you as well Chykan for the “month” setting. I’ve implemented those as well. One thing it wont do is go past 30 days. So december is only showing 30 days for example. It seems to be locked to 5 rows of 6 days. So doesnt want to expand to a 7th row.

I’ll keep playing around with it in the meantime, but any points or guides would be useful to learn form. Thanks

1 Like

Code for mine,
                  - type: custom:week-planner-card
                    calendars:
                      - entity: calendar.australia_tas
                        color: dodgerblue
                        name: Public Holidays
                      - entity: calendar.calendar
                        color: grey
                        name: Maverick
                      - entity: calendar.recycle_pickup_3
                        color: yellow
                        name: Recycling
                      - entity: calendar.rubbish_pickup_3
                        color: green
                        name: Rubbish & FOGO
                      - entity: calendar.birthdays
                        color: crimson
                        name: Birthdays
                      - entity: calendar.hunter
                        color: purple
                        name: Hunter
                    weather:
                      entity: weather.devonport
                      showCondition: true
                      showTemperature: true
                    noCardBackground: true
                    eventBackground: var(--ha-card-background)
                    showLegend: true
                    days: 35
                    startingDay: sunday
                    startingDayOffset: 0
                    dayFormat: >-
                      '<span class="number">'EEE'</span> <span class="month">'d
                      MMM'</span>'
                    compact: true
                    showNavigation: true
                    card_mod:
                      style: |
                        .day.past {
                          opacity: .3;
                        }
                        .today .number {
                          color: crimson;
                          border: solid 2px crimson;
                          border-radius: 4px;
                          background-color: white !important;
                          }
                        .event[data-entity="calendar.recycle_pickup_3"] {
                          background-color: rgba(255,215,0,0.2) !important;
                        }
                        .event[data-entity="calendar.rubbish_pickup_3"] {
                          background-color: rgba(34,139,34,0.2) !important;
                        }
                        .event[data-entity="calendar.australia_tas"] {
                          background-color: rgba(30,144,255,0.2) !important;
                        }
                        .event[data-entity="calendar.birthdays"] {
                          background-color: rgba(220,20,60,0.2) !important;
                        }
                        .event[data-summary="Hunter Home"] {
                          background-color: rgba(106,90,205,0.2) !important;
                        }
                        .event[data-summary="Hunter Fly-Home"] {
                          background-color: rgba(148,0,211,0.5) !important;
                        }
                        .event[data-summary="Hunter Fly-Work"] {
                          background-color: rgba(148,0,211,0.5) !important;
                        }

Thanks for the code, always useful to see how others have done theirs.

But I think the key difference is when you have ‘days’ as a number it allows you to put as much as you want. But if you set 31 for example, and there are only 28 days, it will give you days from the next month.

I noticed the navigation also then in theory says June, but has some of July as well. It can also say July for example when the majority might be August.

When I fix it to ‘month’ it doesnt go past 30 days.

Interesting, and I’ll keep playing with it though. I might create some other styles and templates as well to see which one fits best.

Thanks again

EDIT***


Actually if I set

days: 31
startingDay: month

It mostly works. Puts as many days as possible, then the first couple of days from the next month if it has less than 31.
Months with 31, then display correctly.

1 Like

I changed my dayFormat: to overcome the confusion of the months.

                    dayFormat: >-
                      '<span class="number">'EEE'</span> <span class="month">'d
                      MMM'</span>'
1 Like

Hi,

With the bubble-card mod. How do I set the text colour for the button itself?

At present I have this which allows the background color to change when clicked. The text is white regardless, but I havent specified this anywhere in the button/style config.

    styles: |
      .bubble-button-background {
        opacity: 1 !important;
        background-color: ${hass.states['input_text.person1_calendar_filter'].state === '.*' ? 'light-grey' : '#74F9FD'} !important;}
      }

Probably looking at this all wrong, so advise is appreciated.
Thanks

Ignore, figured it out:

      .bubble-name {
        color : black !important}