Skip to content

Instantly share code, notes, and snippets.

@Mariusthvdb
Last active September 10, 2026 11:41
Show Gist options
  • Select an option

  • Save Mariusthvdb/b5ba9b8e2baf6a4e503fda2a3c3f9f1f to your computer and use it in GitHub Desktop.

Select an option

Save Mariusthvdb/b5ba9b8e2baf6a4e503fda2a3c3f9f1f to your computer and use it in GitHub Desktop.
custom-sidebar-config
##########################################################################################
# Custom-sidebar https://github.com/elchininet/custom-sidebar
# versions
# Custom-sidebar: 17.1.0
# HA: 2026.9.1
# UIX: v8.3.0-beta.3
# @mariusthvdb 2026-09-10
# https://community.home-assistant.io/u/mariusthvdb/summary
#
# still in UIX theme: conditional animations and the notification badge on collapsed menu icon
#
# UIX-broker optionally adds buttons to items, self contained, so not in this config
# except for setting ha-row-item-gap
# see: https://gist.github.com/Mariusthvdb/4246ef379d6978d75224c27e3eb576fe
##########################################################################################
# Global settings
# default_path: /ui-overzicht/welkom
# keep colors even when selected (and not change to the default HA styling in that case)
icon_color_selected: var(--custom-sidebar-icon-color)
text_color_selected: var(--custom-sidebar-text-color)
info_color_selected: var(--custom-sidebar-info-color)
# to not colorize the full background
selection_background: rgba( from var(--custom-sidebar-icon-color) r g b / 0.4)
# selection_opacity: 0.5
item_background_hover: var(--hover-color)
item_background_hover_opacity: 0.1
# sidebar_background: green # dont set here, because double declaration in items
# notification_text_color: ivory
# override the default HA notification color
notification_color: rgba( from var(--custom-sidebar-notification-text-color) r g b / 0.05)
# set a subtle hover with the items notification text color
notification_color_hover: rgba( from var(--custom-sidebar-notification-text-color) r g b / 0.2)
# icon_color_hover: rgba( from var(--custom-sidebar-notification-text-color) r g b / 0.4)
##########################################################################################
# add styling to the plugin settings, and center the badges
##########################################################################################
# :host([expanded]) ha-list-item-button > ha-icon {
# box-shadow: var(--ha-box-shadow-s);
# border-radius: 50%;
# /*border: 1px solid var(--custom-sidebar-icon-color);*/
# /*--mdc-icon-size: 22px;*/
# }
# :host([expanded]) ha-list-item-button {
# /*display: grid;
# grid-template-columns: 24px 176px 30px 30px auto;
# grid-gap: 4px;
# padding: 4px;*/
# }
styles: |
@keyframes marquee {
from {transform: translateX(0%);}
to {transform: translateX(35%);}
}
:host(:not([expanded])) {
/* adjust top padding so badge doesnt get cut */
--ha-list-padding: 8px 0 0 0;
}
:host ha-list-nav {
/* remove ugly spacer so scrolling items slides under Title */
margin-block: 0;
}
:host([expanded]) ha-list-item-button {
/* set ha-row-item-gap between icon and name
so uix-broker buttons don't cause text/secondary ellipsis */
--ha-row-item-gap: 8px;
}
:host([expanded]) ha-list-item-button > .badge {
transform: translateX(50%);
max-width: 36px;
margin: 0 14px 0 0;
box-shadow: var(--ha-box-shadow-m);
border: 1px solid var(--custom-sidebar-notification-text-color, var(--accent-color));
}
:host(:not([expanded])) ha-list-item-button > .badge {
font-size: 0.7em;
font-weight: bold;
/* transform: translateX(-75%);*/ /* replaced by setting left: */
min-width: 1px;
max-width: 34px;
height: 12px;
top: -4px;
left: 0;
border: 1px solid var(--custom-sidebar-notification-text-color, var(--accent-color));
}
.menu .title:after {
font-weight: bold;
animation: marquee 4s alternate infinite;
}
# Only fixed animations!
# When dynamic, based on conditions, requires uix theme
##########################################################################################
# Global variables
##########################################################################################
js_variables:
# title
date_time: sensor.date_time_iso
christmas: input_select.theme
# subtitle
marquee: sensor.marquee_alerts
# overzicht
alerts: sensor.alerts_notifying
# meteo: binary_sensor.meteoalarm_brabant
temp: sensor.ws_5500_outdoor_temperature
vandaag: sensor.vandaag
weather: sensor.weer_alarm_kleur
werkdag: binary_sensor.werkdag
# data
rook: binary_sensor.rook_co_lekkage
veilig: binary_sensor.huis_ramen_deuren_puien_veilig
leakage: binary_sensor.watermeter_leak_detected
boiler_kleur: sensor.zonneboiler_temperatuur_kleur
boiler: sensor.opentherm_dhw_temperature
# klimaat
klimaat: binary_sensor.klimaat_woonkamer_alert
fan: input_boolean.ventilate
# familie
family: sensor.familie_samenvatting
party: binary_sensor.feest_alerts
pres_col: sensor.presence_color
pres_ico: sensor.presence_icon
verjaardag: sensor.volgende_feest_kort
# instellingen
check: binary_sensor.wekker_voor_morgen
next: sensor.next_alarm
pond: switch.vijverpompen
remote: binary_sensor.remote_ui
vak: input_boolean.vakantie
# systeem
core: update.home_assistant_core_update
mem_use: sensor.memory_use_percent
safe: binary_sensor.huis_ramen_deuren_puien_veilig
# cameras
motion: binary_sensor.camera_beweging_buiten
poe: switch.poe_inside_cameras
trash: sensor.afvalwijzer_vandaag
trash_color: sensor.afval_kleur
# energy
levering: binary_sensor.netto_stroom_teruglevering
netto: sensor.netto_verbruik
# test
dag_deel: sensor.dag_deel
##########################################################################################
# Partials derived from the global variables
##########################################################################################
partials:
# window.capitalize = window.capitalize || ((str) => str[0].toUpperCase() + str.slice(1));
# window.translated = window.translated || function(entityId) {
# let retry = 0;
# return new Promise((resolve) => {
# const getStateTranslated = () => {
# const rawStates = states(entityId);
# const translation = state_translated(entityId);
# if (translation !== rawStates) {
# resolve(translation);
# } else if (retry < 100) {
# retry++;
# setTimeout(getStateTranslated, 100);
# } else {
# resolve(rawStates);
# }
# };
# getStateTranslated();
# });
# };
functies: |
const capitalize = str => str[0].toUpperCase() + str.slice(1);
const translated = (entityId) => {
let retry = 0;
return new Promise((resolve) => {
const getStateTranslated = () => {
const rawStates = states(entityId);
const translation = state_translated(entityId);
if (translation !== rawStates) {
resolve(translation);
} else if (retry < 100) {
retry++;
setTimeout(getStateTranslated, 100);
} else {
resolve(rawStates);
}
};
getStateTranslated();
});
};
const titleClick = () => {
const path = '/ui-overzicht/welkom';
window.history.replaceState(null, '', path);
window.dispatchEvent(
new CustomEvent('location-changed', {
detail: {
replace: path
}
})
);
};
# window.titleClick = () => {
# const path = '/ui-overzicht/welkom';
# window.history.replaceState(null, '', path);
# window.dispatchEvent(
# new CustomEvent(
# 'location-changed',
# {
# detail: {
# replace: path
# }
# }
# )
# );
# };
title: |
const tijd = states(date_time);
const tijdStr = new Date( tijd )
.toLocaleTimeString([], {hour:"numeric",minute:"2-digit"});
const kerst = is_state(christmas,'Kerst');
subtitle: |
const marquees = states(marquee);
const phrase = marquees == 1 ? 'Alert: ' : 'Alerts: ';
overzicht: |
const buiten = states(temp);
const datum = states(vandaag);
const vrij = is_state(werkdag,'off');
const waarschuwing = states(alerts) > 0;
const weeralarm = states(weather);
klimaat: |
@partial functies
const ventileer_tl = is_state(klimaat,'on');
const gevaar = is_state(klimaat,'on');
const vent = is_state(fan,'on');
data: |
@partial functies
const gevaar = is_state(rook,'on');
const gesloten = is_state(veilig,'on');
const lek = is_state(leakage,'on');
const boil_kleur = states(boiler_kleur);
const boil_temp = states(boiler, { with_unit: true });
const rook_tl = translated(rook);
familie: |
const aanwezig_ico = states(pres_ico);
const aanwezig_kleur = states(pres_col);
const fam = states(family);
const feest = is_state(party,'on');
const verj = states(verjaardag);
instellingen: |
const cloud = is_state(remote,'on');
const vijver = is_state(pond,'on');
const wakker = states(next);
const wekker = is_state(check,'on');
const vakantie = is_state(vak,'on');
systeem: |
const geheugen = states(mem_use);
const gereed = is_state(safe,'on');
const update = is_state(core,'on');
cameras: |
@partial functies
const actief = is_state(poe,'on');
const afval = (states(trash));
const afval_kleur = states(trash_color);
const beweging = is_state(motion,'on');
energy: |
const nettov = is_state(levering,'on');
const energy_color = nettov ? 'var(--power-color)' : 'brown';
test: |
var kleuren = {'Morgen':'var(--info-color)',
'Middag':'var(--success-color)',
'Avond':'var(--warning-color)',
'Nacht':'var(--state-sun-below_horizon-color)'};
const deel = states(dag_deel);
##########################################################################################
# Menu settings
##########################################################################################
menu_background: >
[[[ @partial familie
return feest ? 'top / cover url(/local/images/balloons.png)'
: 'var(--header-background)'; ]]]
title: |
[[[
@partial functies @partial title
window.titleClick = titleClick;
const event = 'ontouchstart' in window
? 'ontouchstart'
: 'onclick';
return `<span style="cursor:pointer"
${event}="javascript:titleClick()">
Rumah kami: ${tijdStr}
</span>`;
]]]
title_color: >
[[[ states('sensor.presence_color'); ]]]
subtitle: >
[[[ @partial subtitle
return marquees != 0 ? phrase + marquees : ''; ]]]
subtitle_color: var(--alert-color)
##########################################################################################
# Sidebar settings
##########################################################################################
sidebar_editable: >
[[[ is_state('input_boolean.sidebar_editable','on'); ]]]
sidebar_button_color: >
[[[ @partial overzicht
return waarschuwing ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
sidebar_border_color: var(--primary-color)
sidebar_background: >
[[[ @partial title
return kerst ? 'url(/local/season/kerst_smurfen.png)' : 'inherit'; ]]]
##########################################################################################
# Dashboards
##########################################################################################
order:
- item: ui-overzicht
match: href
# order: 1
icon: >
[[[ @partial overzicht
return waarschuwing ? 'mdi:home-alert' : 'cli:home-check'; ]]]
icon_color: >
[[[ @partial overzicht
return waarschuwing ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
notification: >
[[[ states(temp); ]]]
# notification_color: >
# [[[ states('sensor.temperature_color_name'); ]]]
notification_text_color: >
[[[ states('sensor.temperature_color_name'); ]]]
# [[[ @partial overzicht
# return (buiten > 5 && buiten < 15) ? 'dimgray' : 'ivory'; ]]]
info: >
[[[ @partial overzicht
return datum; ]]]
info_color: >
[[[ @partial overzicht
return vrij ? 'var(--success-color)' : 'var(--warning-color)'; ]]]
##########################################################################################
- item: ui-data
match: href
# order: 2
icon: >
[[[ @partial data
return lek ? 'mdi:pipe-leak' : 'mdi:home-analytics'; ]]]
icon_color: >
[[[ @partial data
return gevaar ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
notification: >
[[[ @partial data
return rook_tl; ]]]
# notification_color: >
# [[[ @partial data
# return gevaar ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
notification_text_color: >
[[[ @partial data
return lek ? 'blue'
: gevaar ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
text_color: >
[[[ @partial data
return lek ? 'blue' : 'var(--custom-sidebar-text-color)'; ]]]
info: >
[[[ @partial data
return gesloten ? 'Huis Gesloten' : 'Huis Geopend'; ]]]
info_color: >
[[[ @partial data
return gesloten ? 'var(--success-color)' : 'var(--alert-color)'; ]]]
item_background: >
[[[ @partial data
return lek ? 'lightblue' : ''; ]]]
##########################################################################################
- item: huis-klimaat
match: href
# order: 2
icon: >
[[[ @partial klimaat
return gevaar || vent ? 'mdi:fan' : 'mdi:home-thermometer'; ]]]
icon_color: >
[[[ @partial klimaat
return gevaar || vent ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
notification: >
[[[ @partial klimaat
return gevaar || vent ? 'Vocht' : translated(klimaat); ]]]
notification_text_color: >
[[[ @partial klimaat
return gevaar ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
info: |
[[[ @partial data
return 'Zonneboiler: ' + boil_temp; ]]]
info_color: >
[[[ @partial data
return boil_kleur; ]]]
##########################################################################################
- item: ui-familie
match: href
# order: 3
icon: >
[[[ @partial familie
return feest ? 'mdi:party-popper' : 'mdi:home-account'; ]]]
icon_color: >
[[[ @partial familie
return feest ? 'var(--warning-color)' : aanwezig_kleur; ]]]
notification: >
[[[ @partial familie
return fam; ]]]
notification_text_color: >
[[[ @partial familie
return aanwezig_kleur; ]]]
# notification_text_color: >
# [[[ @partial familie
# return aanwezig_kleur == 'gold' ? 'saddlebrown' : 'ivory'; ]]]
info: >
[[[ @partial familie
return verj; ]]]
info_color: >
[[[ @partial familie
return feest ? 'var(--warning-color)' : 'var(--info-color)'; ]]]
##########################################################################################
- item: ui-instellingen
match: href
# order: 4
icon: >
[[[ @partial instellingen
return wekker ? 'mdi:alarm' : 'cli:home-cog' ]]]
icon_color: >
[[[ @partial instellingen
return wekker ? 'var(--alert-color)' : 'var(--succes-color)'; ]]]
notification: >
[[[ @partial instellingen
return vakantie ? 'Vakantie'
: wekker ? wakker : ''; ]]]
# notification_text_color:
# [[[ @partial instellingen
# return vakantie ? 'ivory'
# : wekker ? 'ivory' : 'var(--success-color)'; ]]]
notification_text_color: >
[[[ @partial instellingen
return vakantie ? 'var(--warning-color)'
: wekker ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
info: >
[[[ @partial instellingen
return cloud ? 'Cloud: aan' : 'Cloud: uit'; ]]]
info_color: >
[[[ @partial instellingen
return cloud ? 'var(--warning-color)' : 'var(--info-color)'; ]]]
##########################################################################################
- item: ui-develop
match: href
# order: 5
icon: >
[[[ @partial systeem
return update ? 'mdi:package-up' : 'mdi:home-assistant'; ]]]
icon_color: >
[[[ @partial systeem
return update || geheugen > 50 ? 'var(--alert-color)' : 'var(--ha-color)'; ]]]
notification: >
[[[ @partial systeem
return geheugen; ]]]
notification_text_color: >
[[[ @partial systeem
return geheugen > 50 ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
info: >
[[[ state_attr('update.home_assistant_core_update','installed_version'); ]]]
info_color: >
[[[ @partial systeem
return update ? 'var(--alert-color)' : 'var(--ha-color)'; ]]]
##########################################################################################
- item: ui-cctv
match: href
color: red
# order: 6
icon: >
[[[ @partial cameras
return beweging ? 'mdi:camera-control' : 'cli:home-video-outline'; ]]]
icon_color: >
[[[ @partial cameras
return actief ? 'var(--alert-color)' : ''; ]]]
notification: >
[[[ @partial cameras
return beweging ? 'Actie' : 'Rust'; ]]]
# notification_color: >
# [[[ @partial cameras
# return beweging ? 'var(--alert-color)' : 'var(--success-color)'; ]]]
notification_text_color: >
[[[ @partial cameras
return beweging ? 'var(--warning-color)' : 'var(--success-color)'; ]]]
text_color: >
[[[ @partial cameras
return beweging ? 'var(--warning-color)' : 'var(--custom-sidebar-text-color)'; ]]]
item_background: >
[[[ @partial cameras
return beweging ? 'var(--alert-color)' : ''; ]]]
info: >
[[[ @partial cameras
return afval === 'geen' ? ' ' : capitalize(afval) ; ]]]
info_color: >
[[[ @partial cameras
return afval_kleur; ]]]
##########################################################################################
- item: energy
match: href
# order: 7
icon: >
[[[ @partial energy
return nettov ? 'mdi:home-lightning-bolt'
: 'mdi:home-lightning-bolt-outline'; ]]]
icon_color: >
[[[ @partial energy
return energy_color; ]]]
notification: >
[[[ return states(netto); ]]]
notification_text_color: >
[[[ @partial energy;
return energy_color; ]]]
info: >
[[[ @partial energy
return nettov ? 'Levering' : 'Verbruik'; ]]]
info_color: >
[[[ @partial energy
return energy_color; ]]]
divider: true
divider_color: >
[[[ @partial energy
return energy_color; ]]]
- item: ui-utiliteiten
match: href
# order: 8
- item: ui-test
match: href
# order: 9
icon_color: >
[[[ @partial test
return kleuren[deel]; ]]]
info: >
[[[ @partial test
return kleuren[deel]; ]]]
info_color: >
[[[ @partial test
return kleuren[deel]; ]]]
##########################################################################################
# Ui dashboards
##########################################################################################
- item: ui-configured
match: href
# order: 10
# bottom: true
- item: home
match: href
# order: 14
# bottom: true
- item: huis-per-ruimte
match: href
# order: 11
# bottom: true
icon_color: var(--success-color)
info: >
{{floors()|count}} Floors, {{areas()|count}} Areas
info_color: var(--warning-color)
notification: >
{{floors()|count}} | {{areas()|count}}
notification_text_color: var(--success-color)
# - item: dashboard-areas
# match: href
# order: 11
# bottom: true
# icon_color: var(--warning-color)
# info: >
# Gegroepeerd in {{floors()|count}} 'floors'
# info_color: var(--info-color)
# notification: >
# {{areas()|count}}
# notification_color: green
- item: per-ruimte-auto
match: href
# order: 12
# bottom: true
- item: dashboard-ruimtes
match: href
# order: 13
# bottom: true
##########################################################################################
# Hide menu items, either here or in HA profile settings
# beware, if hidden in profile settings, this plugin can Not see them and errors on
# referencing them
##########################################################################################
# - item: light
# match: href
# hide: true
#
# - item: security
# match: href
# hide: true
#
# - item: climate
# match: href
# hide: true
#
# # - item: browser-mod
# # match: href
# # hide: true
# uncomment these 2 system items
# for applying the badge styling using notification_text_color
- item: /config
match: href
bottom: true
notification_text_color: var(--warning-color)
# hide: true
- item: Meldingen
match: exact
bottom: true
notification_text_color: var(--warning-color)
# hide: true
# - item: /profile
# order: 2
# item_background: >
# [[[ is_state('person.marijn','home') ? 'green' : 'gray'; ]]]
# notification_text_color: >
# [[[ is_state('person.marijn','home') ? 'ivory' : 'black'; ]]]
# bottom: true
# match: href
# #
# # - item: logbook
# # match: href
# # hide: true
# # - item: history
# # match: href
# # hide: true
# # - item: calendar
# # match: href
# # hide: true
# # - item: todo
# # match: href
# # hide: true
# # - item: media
# # hide: true
# # - item: resources
# # hide: true
@iAmRenzo

Copy link
Copy Markdown

You have a screenshot of the result?

@Mariusthvdb

Copy link
Copy Markdown
Author

that must be available in the community in the dedicated thread.
Not sharing images here preferably

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment