updated holidays to look different
This commit is contained in:
40
README.md
40
README.md
@@ -13,3 +13,43 @@ To connect you calendar you'll need to add the CalDAV integration to your Home A
|
|||||||
- For nextcloud users it's something like: `https://[YOUR_NEXTCLOUD_URL].com/remote.php/dav` (you can also find it in the nextcloud calendar settings > Copy pirmary CalDAV address)
|
- For nextcloud users it's something like: `https://[YOUR_NEXTCLOUD_URL].com/remote.php/dav` (you can also find it in the nextcloud calendar settings > Copy pirmary CalDAV address)
|
||||||
- The username and password of the user you want to add the calendar for
|
- The username and password of the user you want to add the calendar for
|
||||||
|
|
||||||
|
## Scripts and Helpers
|
||||||
|
These are probably the most important part of the whole set up as if you don't have them set, you can't do any of the filtering
|
||||||
|
|
||||||
|
For each calendar or person you need to have this script located in `Settings > Automations & scenes > scripts`
|
||||||
|
```yaml
|
||||||
|
alias: [CALENDAR_OR_PERSON_NAME] Calendar Visible Filter
|
||||||
|
description: "Shows or hides events for [CALENDAR_OR_PERSON_NAME] Calendar"
|
||||||
|
sequence:
|
||||||
|
- data:
|
||||||
|
entity_id: input_text.[CALENDAR_OR_PERSON_NAME]_calendar_filter
|
||||||
|
value: |
|
||||||
|
{% if is_state('input_text.[CALENDAR_OR_PERSON_NAME]_calendar_filter', '.*') %}
|
||||||
|
^$
|
||||||
|
{% else %}
|
||||||
|
.*
|
||||||
|
{% endif %}
|
||||||
|
action: input_text.set_value
|
||||||
|
```
|
||||||
|
|
||||||
|
The Helpers you need to add are as follows:
|
||||||
|
Text:
|
||||||
|
“calendar_event_title”
|
||||||
|
“calendar_event_description”
|
||||||
|
“birthdays_calendar_filter”
|
||||||
|
“[CALENDAR_OR_PERSON_NAME]_calendar_filter”
|
||||||
|
|
||||||
|
Dropdown:
|
||||||
|
“calendar_select” (add your calendar options)
|
||||||
|
“calendar_view” (options: Today, Tomorrow, Week, Biweek, Month, Bimonth)
|
||||||
|
|
||||||
|
Datetime (Date):
|
||||||
|
“calendar_day_event_start”
|
||||||
|
“calendar_day_event_end”
|
||||||
|
|
||||||
|
Datetime (Time)
|
||||||
|
“calendar_event_start”
|
||||||
|
“calendar_event_end”
|
||||||
|
|
||||||
|
Toggle:
|
||||||
|
“calendar_all_day_event”
|
||||||
95
config.yaml
95
config.yaml
@@ -1,3 +1,6 @@
|
|||||||
|
kiosk_mode:
|
||||||
|
hide_header: '[[[ user_name === "Viewer" ]]]'
|
||||||
|
hide_sidebar: '[[[ is_state("input_boolean.hide_sidebar", "on") ]]]'
|
||||||
views:
|
views:
|
||||||
- title: Home
|
- title: Home
|
||||||
sections:
|
sections:
|
||||||
@@ -74,8 +77,30 @@ views:
|
|||||||
styles: |
|
styles: |
|
||||||
.bubble-button-background {
|
.bubble-button-background {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
background-color: ${hass.states['input_text.brian_calendar_filter'].state === '.*' ? 'light-grey' : 'rgba(15, 208, 184, 0.3)'} !important;}
|
background-color: ${hass.states['input_text.brian_calendar_filter'].state === '.*' ? 'light-grey' : 'rgba(15, 208, 184, 0.3)'} !important;}
|
||||||
}
|
}
|
||||||
|
- type: custom:bubble-card
|
||||||
|
card_type: button
|
||||||
|
button_type: state
|
||||||
|
entity: person.kate
|
||||||
|
scrolling_effect: false
|
||||||
|
show_icon: true
|
||||||
|
show_name: true
|
||||||
|
show_state: false
|
||||||
|
tap_action:
|
||||||
|
action: perform-action
|
||||||
|
perform_action: script.kate_calendar_visible_filter_duplicate
|
||||||
|
target: {}
|
||||||
|
button_action:
|
||||||
|
tap_action:
|
||||||
|
action: perform-action
|
||||||
|
perform_action: script.kate_calendar_visible_filter_duplicate
|
||||||
|
target: {}
|
||||||
|
styles: |
|
||||||
|
.bubble-button-background {
|
||||||
|
opacity: 1 !important;
|
||||||
|
background-color: ${hass.states['input_text.kate_calendar_filter'].state === '.*' ? 'light-grey' : 'rgba(240, 8, 130, 0.5)'} !important;}
|
||||||
|
}
|
||||||
- type: custom:bubble-card
|
- type: custom:bubble-card
|
||||||
card_type: button
|
card_type: button
|
||||||
button_type: state
|
button_type: state
|
||||||
@@ -98,7 +123,29 @@ views:
|
|||||||
.bubble-button-background {
|
.bubble-button-background {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
background-color: ${hass.states['input_text.dog_calendar_filter'].state === '.*' ? 'light-grey' : 'rgba(15, 100, 255, 0.5)'} !important;}
|
background-color: ${hass.states['input_text.dog_calendar_filter'].state === '.*' ? 'light-grey' : 'rgba(15, 100, 255, 0.5)'} !important;}
|
||||||
}
|
}
|
||||||
|
- type: custom:bubble-card
|
||||||
|
card_type: button
|
||||||
|
button_type: state
|
||||||
|
entity: calendar.holidays
|
||||||
|
scrolling_effect: false
|
||||||
|
show_icon: true
|
||||||
|
show_name: true
|
||||||
|
show_state: false
|
||||||
|
tap_action:
|
||||||
|
action: perform-action
|
||||||
|
perform_action: script.holiday_calendar_visible_filter
|
||||||
|
target: {}
|
||||||
|
button_action:
|
||||||
|
tap_action:
|
||||||
|
action: perform-action
|
||||||
|
perform_action: script.holiday_calendar_visible_filter
|
||||||
|
target: {}
|
||||||
|
styles: |
|
||||||
|
.bubble-button-background {
|
||||||
|
opacity: 1 !important;
|
||||||
|
background-color: ${hass.states['input_text.holiday_calendar_filter'].state === '.*' ? 'light-grey' : 'rgba(175, 150, 255, 0.6)'} !important;}
|
||||||
|
}
|
||||||
- type: custom:bubble-card
|
- type: custom:bubble-card
|
||||||
card_type: button
|
card_type: button
|
||||||
button_type: name
|
button_type: name
|
||||||
@@ -156,11 +203,15 @@ views:
|
|||||||
- type: custom:config-template-card
|
- type: custom:config-template-card
|
||||||
entities:
|
entities:
|
||||||
- input_text.brian_calendar_filter
|
- input_text.brian_calendar_filter
|
||||||
|
- input_text.kate_calendar_filter
|
||||||
- input_text.dog_calendar_filter
|
- input_text.dog_calendar_filter
|
||||||
|
- input_text.holiday_calendar_filter
|
||||||
- inpup_select.calendar_view
|
- inpup_select.calendar_view
|
||||||
variables:
|
variables:
|
||||||
PERSONCAL: states['input_text.brian_calendar_filter']?.state
|
PERSONCAL: states['input_text.brian_calendar_filter']?.state
|
||||||
|
PERSON2CAL: states['input_text.kate_calendar_filter']?.state
|
||||||
DOGCAL: states['input_text.dog_calendar_filter']?.state
|
DOGCAL: states['input_text.dog_calendar_filter']?.state
|
||||||
|
HOLCAL: states['input_text.holiday_calendar_filter']?.state
|
||||||
VIEW: states['input_select.calendar_view']?.state
|
VIEW: states['input_select.calendar_view']?.state
|
||||||
DAYS: |
|
DAYS: |
|
||||||
(() => {
|
(() => {
|
||||||
@@ -176,7 +227,7 @@ views:
|
|||||||
if (calendarView === 'Bimonth') return 56;
|
if (calendarView === 'Bimonth') return 56;
|
||||||
|
|
||||||
// Default fallback to 7 if no condition matches
|
// Default fallback to 7 if no condition matches
|
||||||
return 28;
|
return 7;
|
||||||
})()
|
})()
|
||||||
card:
|
card:
|
||||||
type: custom:week-planner-card
|
type: custom:week-planner-card
|
||||||
@@ -185,13 +236,21 @@ views:
|
|||||||
name: brian
|
name: brian
|
||||||
color: rgba(15, 208, 184, 0.3)
|
color: rgba(15, 208, 184, 0.3)
|
||||||
filter: ${ PERSONCAL }
|
filter: ${ PERSONCAL }
|
||||||
|
- entity: calendar.kate
|
||||||
|
name: kate
|
||||||
|
color: rgba(223, 8, 119, 0.35)
|
||||||
|
filter: ${ PERSON2CAL }
|
||||||
- entity: calendar.dogs
|
- entity: calendar.dogs
|
||||||
name: dogs
|
name: dogs
|
||||||
color: rgba(15, 100, 255, 0.5)
|
color: rgba(15, 100, 255, 0.5)
|
||||||
filter: ${ DOGCAL }
|
filter: ${ DOGCAL }
|
||||||
|
- entity: calendar.holidays
|
||||||
|
name: holidays
|
||||||
|
color: rgba(175, 150, 255, 0.6)
|
||||||
|
filter: ${ HOLCAL }
|
||||||
days: ${ DAYS }
|
days: ${ DAYS }
|
||||||
startingDayOffset: 0
|
|
||||||
startingDay: sunday
|
startingDay: sunday
|
||||||
|
startingDayOffset: 0
|
||||||
hideWeekend: false
|
hideWeekend: false
|
||||||
noCardBackground: false
|
noCardBackground: false
|
||||||
compact: false
|
compact: false
|
||||||
@@ -225,8 +284,7 @@ views:
|
|||||||
style: |
|
style: |
|
||||||
ha-card {
|
ha-card {
|
||||||
.event.past {
|
.event.past {
|
||||||
opacity: .2;
|
opacity: .3;
|
||||||
background-color: gray !important;
|
|
||||||
}
|
}
|
||||||
.time {
|
.time {
|
||||||
color: #333333 !important;
|
color: #333333 !important;
|
||||||
@@ -241,6 +299,12 @@ views:
|
|||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
font-size: 1.1em !important;
|
font-size: 1.1em !important;
|
||||||
}
|
}
|
||||||
|
.fullday .inner {
|
||||||
|
padding: 0.25rem !important;
|
||||||
|
}
|
||||||
|
.fullday .inner .time {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
.none {
|
.none {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
@@ -264,11 +328,8 @@ views:
|
|||||||
--background-color: red;
|
--background-color: red;
|
||||||
border: solid 1px whitesmoke;
|
border: solid 1px whitesmoke;
|
||||||
padding: 0.2%;
|
padding: 0.2%;
|
||||||
width: 13% !important;
|
width: 12% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
grid_options:
|
grid_options:
|
||||||
columns: full
|
columns: full
|
||||||
@@ -289,9 +350,11 @@ views:
|
|||||||
${hass.states['input_select.calendar_select'].state ==
|
${hass.states['input_select.calendar_select'].state ==
|
||||||
'brian' ? 'rgba(15, 208, 184, 0.3)'
|
'brian' ? 'rgba(15, 208, 184, 0.3)'
|
||||||
: hass.states['input_select.calendar_select'].state ==
|
: hass.states['input_select.calendar_select'].state ==
|
||||||
|
'kate' ? 'rgba(223, 8, 119, 0.35)'
|
||||||
|
: hass.states['input_select.calendar_select'].state ==
|
||||||
'dogs' ? 'rgba(15, 100, 255, 0.5)'
|
'dogs' ? 'rgba(15, 100, 255, 0.5)'
|
||||||
: hass.states['input_select.calendar_select'].state ==
|
: hass.states['input_select.calendar_select'].state ==
|
||||||
'Birthdays' ? '#000000'
|
'Birthdays' ? 'light-grey'
|
||||||
: 'red'} !important;
|
: 'red'} !important;
|
||||||
}
|
}
|
||||||
modules: []
|
modules: []
|
||||||
@@ -315,6 +378,10 @@ views:
|
|||||||
card:
|
card:
|
||||||
type: entities
|
type: entities
|
||||||
entities:
|
entities:
|
||||||
|
- entity: input_datetime.calendar_day_event_start
|
||||||
|
name: Event Start Date
|
||||||
|
- entity: input_datetime.calendar_day_event_end
|
||||||
|
name: Event End Date
|
||||||
- entity: input_datetime.calendar_event_start
|
- entity: input_datetime.calendar_event_start
|
||||||
name: Start Time
|
name: Start Time
|
||||||
- entity: input_datetime.calendar_event_end
|
- entity: input_datetime.calendar_event_end
|
||||||
@@ -341,6 +408,8 @@ views:
|
|||||||
[[[
|
[[[
|
||||||
if (states['input_select.calendar_select'].state == 'brian')
|
if (states['input_select.calendar_select'].state == 'brian')
|
||||||
return "rgba(15, 208, 184, 0.3)";
|
return "rgba(15, 208, 184, 0.3)";
|
||||||
|
if (states['input_select.calendar_select'].state == 'kate')
|
||||||
|
return "rgba(223, 8, 119, 0.35)";
|
||||||
if (states['input_select.calendar_select'].state == 'dogs')
|
if (states['input_select.calendar_select'].state == 'dogs')
|
||||||
return "rgba(15, 100, 255, 0.5)";
|
return "rgba(15, 100, 255, 0.5)";
|
||||||
if (states['input_select.calendar_select'].state == 'Birthdays')
|
if (states['input_select.calendar_select'].state == 'Birthdays')
|
||||||
|
|||||||
Reference in New Issue
Block a user