Lovelace: custom sidebar card

Hi Ezpll,

Use F12 here and take a look into the console errors. I found with mine that there was a funky error image
which had around 100 replies on ways to shift the JS code to fix it.

Good luck!

1 Like

Hello
After changing to daylight saving time, my time is incorrect.
What to do for a good time?

Damn. It looks like w/ 2023.4 this card is completely broken. Too bad - it was a major influencer for the rest of my dashboard :frowning:

1 Like

Also fully browser is broken with this update.

Hello,

Im updating my home assistant and will see what the problem is and look for a fix and if needed i will update the card.

3 Likes

I just updated the card, it looks all good for me. let me know if you still got issues!

2 Likes

There is an issue with the update. if you go to other page it redraws the sidebar inside the old one so you get multiple sidebars…
Working on this issue.

1 Like

Thanks for the update. I have run the latest version 1.9.1 but my sidebar is totally not showing anywhere. Well i’ll be awaiting an update, love this addon as it give great addition to the Tablet on the wall :slight_smile:

Any error in the console? did you reload resources and clear cache?

After clear cache

seems my Pi was working on a lot of things and not every frontend part was reloaded correctly. Now I do see the sidebar again :slight_smile:

hi DBuit
im run latest ver 1.9.1, my sidebar not showing well

3 Likes

is anyone able to help me get started with this? I am having trouble getting the sidebar setup, I am not sure what needs to go inside of the sidebar.yaml file versus the ui-lovelace.yaml file.

I am trying to get it setup as follows.

Sidebar
Time:
Date:

Page 1
Page 2
Page 3

People Home

Weather

Right side
Floor plan

Latest update working fine in Fully Kiosk on my hallway tablet. Needed to temporarily change the Cache settings in Fully Kiosk to properly refresh and get the changes, but otherwise fine. Thanks for the update @DBuit !

I’ve setup a separate dashboard in the UI and manually edited the YAML to include the sidebar code ahead of the regular lovelace YAML. See below my own code as reference. (“views:” at the bottom is the beginning of the regular YAML for lovelace)

title: Dashboard
sidebar:
  title: null
  clock: false
  digitalClock: true
  digitalClockWithSeconds: false
  twelveHourVersion: false
  period: false
  date: true
  hideTopMenu: true
  hideHassSidebar: true
  width:
    desktop: 15
    mobile: 15
    tablet: 24
  sidebarMenu:
    - action: navigate
      active: true
      name: MAIN
      icon: mdi:shield-home
      navigation_path: /front-door-lenovo/security
    - action: navigate
      active: true
      name: CLIMATE
      icon: mdi:thermometer
      navigation_path: /front-door-lenovo/climate
    - action: navigate
      active: true
      name: LIGHTS
      icon: mdi:lightbulb-on
      navigation_path: /front-door-lenovo/lights
    - action: navigate
      active: true
      name: CCTV
      icon: mdi:cctv
      navigation_path: /front-door-lenovo/cctv
    - action: toggle
      entity: input_boolean.guest_mode
      state: input_boolean.guest_mode
      name: GUEST
      icon: mdi:face-man
  style: |
    :host {
        --sidebar-background: #000;
        --sidebar-text-color: #EEE;
views:

I think you are encountering exactly this problem Not working in 2023.4 · Issue #83 · DBuit/sidebar-card · GitHub

Also, my bottomcard “weather card” broke with the new HA 2023.4 and sidebar-card 0.1.9.1. I’ve now changed the bottomcard to be at relative position and had to remove all margins. See my solution below
(do you have a better solution @DBuit ?)

bottomCard:
    type: weather-forecast
    cardOptions:
      name: Home
      show_forecast: true
      entity: weather.forecast_home
      tap_action:
        action: navigate
        navigation_path: /dashboard-tablet/wetter
    cardStyle: |
      :host {
        width: 100%;
        position: relative;
        bottom: 0;
        left: 0;
      }
      ha-card {
        padding: none;
        width: 110%;
        border: none;
        background: none;
        overflow: hidden !important;
        box-shadow: none !important;
        ha-card-border-radius: 0px;
        margin-top: -16px;
        margin-right: -10px;
        margin-left: -10px;        
      }

Here is my full-configuration GitHub - Mika255/HomeAssistant: Home Assistant Lovelace configuration

3 Likes

Here is my configuration.yaml

# Home Assistant configuration file

# Enable the frontend
frontend:

# Enable the recorder
recorder:
  purge_keep_days: 30

# Configure the DBuit sidebar-card plugin
dbuit_sidebar_card:
  background: 'var(--primary-color)'
  font-size: 14px
  default_width: 300px
  swipe_overlay_opacity: 0.6

# Configure the Lovelace UI
lovelace:
  # Use the YAML mode for Lovelace
  mode: yaml
  # Include the sidebar-card plugin
  resources:
    - url: /local/sidebar-card.js
      type: module

Here is my ui-lovelace.yaml

title: Dashboard
sidebar:
  title: null
  clock: false
  digitalClock: true
  digitalClockWithSeconds: false
  twelveHourVersion: false
  period: false
  date: true
  hideTopMenu: true
  hideHassSidebar: true
  width:
    desktop: 15
    mobile: 15
    tablet: 24
  sidebarMenu:
    - action: navigate
      active: true
      name: MAIN
      icon: mdi:shield-home
      navigation_path: /front-door-lenovo/security
    - action: navigate
      active: true
      name: CLIMATE
      icon: mdi:thermometer
      navigation_path: /front-door-lenovo/climate
    - action: navigate
      active: true
      name: LIGHTS
      icon: mdi:lightbulb-on
      navigation_path: /front-door-lenovo/lights
    - action: navigate
      active: true
      name: CCTV
      icon: mdi:cctv
      navigation_path: /front-door-lenovo/cctv
    - action: toggle
      entity: input_boolean.guest_mode
      state: input_boolean.guest_mode
      name: GUEST
      icon: mdi:face-man
  style: |
    :host {
        --sidebar-background: #000;
        --sidebar-text-color: #EEE;
views:

And the image is what my homeassistant looks like after restarting.

The only reference I have to the sidebar card in my configuration,yaml file is below:

lovelace:
  mode: yaml
  resources:
    - url: /hacsfiles/sidebar-card/sidebar-card.js
      type: module

I have installed sidebar card via HACS. Manual installation will have a different URL. Do you have any other resources installed, and do they work ok? It might be an installation issue. You have to reboot after adding these to your config file.

Your code for lovelace.yaml isn’t going to work because it has the navigation_path specifically for my own dashboard and not your own ("/front-door-lenovo/lights") - you need to identify the path for each lovelace tab. Your lovelace file is a single file that contains the code for the sidebar, but also the code for all other pages.

I would recommend resetting your lovelace to be automatically generated, and then use the home assistant settings to create a brand new dashboard just for testing. It will be easier to add the resource there, and you can generate a simple dashboard first using the UI before adding the sidebar code.

I am still just getting a full black screen.

Configuration.yaml


# Loads default set of integrations. Do not remove.
default_config:

# Add the /tmp folder
homeassistant:
  allowlist_external_dirs:
  - "/tmp"

#frontend:
#  themes: !include_dir_merge_named themes

# Add cloud integration

cloud:

# Text to speech
tts:
  - platform: google_translate

# Uncomment below for script automation and scene integration

#script: !include scripts.yaml
#automation: !include automations.yaml
#scene: !include scenes.yaml
#template: !include sidebar.yaml

frontend:
  extra_module_url:
    - /hacsfiles/lovelace-card-mod/card-mod.js
  themes: !include_dir_merge_named themes



lovelace:
  mode: yaml
  resources:
    - url: /hacsfiles/sidebar-card/sidebar-card.js
      type: module

ui-lovelace.yaml

title: Dashboard
sidebar:
  title: null
  clock: false
  digitalClock: true
  digitalClockWithSeconds: false
  twelveHourVersion: false
  period: false
  date: true
  hideTopMenu: true
  hideHassSidebar: true
  width:
    desktop: 15
    mobile: 15
    tablet: 24
  sidebarMenu:
    - action: navigate
      active: true
      name: MAIN
      icon: mdi:shield-home
      navigation_path: /front-door-lenovo/security
    - action: navigate
      active: true
      name: CLIMATE
      icon: mdi:thermometer
      navigation_path: /front-door-lenovo/climate
    - action: navigate
      active: true
      name: LIGHTS
      icon: mdi:lightbulb-on
      navigation_path: /front-door-lenovo/lights
    - action: navigate
      active: true
      name: CCTV
      icon: mdi:cctv
      navigation_path: /front-door-lenovo/cctv
    - action: toggle
      entity: input_boolean.guest_mode
      state: input_boolean.guest_mode
      name: GUEST
      icon: mdi:face-man
  style: |
    :host {
        --sidebar-background: #000;
        --sidebar-text-color: #EEE;
views:

I also installed sidebar through the HACS store.

Sorry just read the rest of that. I completely reinstalled my home assistant and changed the configuration file and ui-lovelace.yaml to what you provided and then I installed HACS and the sidebar card.

What do you mean by resetting lovelace to be automatically generated?