Google calendar color

Hi everyone. Is there a way to change the colors of the various calendars integrated by google calendar?
I have tried many plugins (card-mod, atomic-calendar-revive). I have achieved some results but I have not found a way to change the colors that default home assistant assigns from the original calendar integration tab

thank you all

3 Likes

The calendar section will list each calendar in alphabetical order based on “device_id”. Open up the calendar.yaml file and add #'s in front of each device ID to order them.

  - device_id: office

would become

  - device_id: 4office

The name won’t change (although you can make changes to the name section also), so you will never see these numbers, only Home Assistant will. (or you might later on while building an automation)

Here is the color order:
Red (bright)
Green (midway between light and dark green)
Blue (almost exactly Home Assistant’s blue, little darker)
Purple (Dark)
Teal
Orange
Brown
Purple (Light)
Green (Light/neon)
Magenta
Brown/Orange

I don’t think its possible at this time to skip colors.

4 Likes

Even if you do not have full control of the colors it is an interesting solution to the resolution of the problem. thank you bruck

I’m not sure when, but the order of the colours appears to have changed. I’m now seeing the following order:

  1. Blue
  2. Mauve
  3. Teal
  4. Orange
  5. Gold
  6. Purple
  7. Lime Green
  8. Red

Has anyone else noticed this change? Is there anywhere I can look for the official colour ordering? I would like to get my calendar back to its original “encoding”.

unfortunately the order has changed for me too

Just to add to Juggler’s list…

  1. Blue
  2. Mauve
  3. Teal
  4. Orange
  5. Gold
  6. Purple
  7. Lime Green
  8. Red
  1. Burnt Orange/Brown
  2. Pink
  3. Mint
  4. Light Purple
  5. Coral
  6. Light Blue
  7. Light Orange
  8. Light Pink
  9. Medium Purple
  10. Yellow
  11. Pale Blue
  12. Amber
  13. Green
  14. Red-Orange
  15. Fuchsia
  16. Golden Yellow
  17. Brown
  18. Bright Blue
  19. True Red

Colour names open to interpretation. :wink:

1 Like

I wish there was a way to assign a colour to a calendar. This is how I do it for all my other calendar clients and it allows me to easily distinguish between personal/work/sports calendars. Does anyone have any hacks to do this?

4 Likes

I used that list above and created fill calendars to push my other calendars to the color I wanted and as long as you don’t ever use the filler calendars they shouldn’t show up on the calendar in HA. Pretty big PIA though I second being able to select colors easier.

edit When I say do this I am referring to the lovelace integration as you can select what order you want your calendars in there. As far as the main one that goes alphabetically, I am not sure.

I completely agree. I have many calendars spread across family members and type of event; having the colors not match what I use in my primary system (Google) makes it very difficult to use the calendar in Home Assistant. The ability to manually choose a color would allow me to move more into the HA ecosystem.

2 Likes

To cwhiii
I completely agree with you. I am in the same situation !
:wink:

1 Like

I’m not a coder but I believe it’s line 148 of this file
So what could be done is that this line would check if there’s a color attribute, if yes, use that, if no fall back on one of these random colors.

For example I could add the attribute colour in my customize.yaml file

calendar.personal:
   colour: green

and line 148 would be in pseudo code

.map((eid, idx) => ({
      entity_id: eid,
      name: computeStateName(hass.states[eid]),
      backgroundColor: hass.states[eid].colour if (hass.states[eid].colour)  else getColorByIndex(idx) ,
    }));

but I don’t know what’s the correct syntax to get the colour attribute; or how to write a decent inline if in python… (I may also be totally wrong about everything in my post, I don’t know the codebase either).

is there some way to beg one of the coders to consider this?

FYI, a change like that wouldn’t get implemented as it uses the properties of the calendar in customize.yaml. A system would need to be discussed to color calendars by calendar name (or something else) in the frontend theme. Currently the only way to change any colors in a supported way is via frontend themes. Otherwise you’d have to use something custom.

2 Likes

I forgot to update this, seemingly there’s a discussion about using colours in HA in github.

but where is the calendar.yaml file located