Yet another responsive Dashboard with Sidebar (HA Dashboard)

I created another Dashboard.
My dashboard is completely responsive, so it can be used on desktop, tablets and also on the mobile app.
It has a sidebar, which is usable for current information. On small devices with a small screen (less than 1024px width) the sidebar will be automatically hidden.
The main view (the dashboard itself) is based on the default hui-masonry-view, so it’s completely configurable and every card can be add…
Another nice feature is, that the cards can be added comfortable with the help of the UI.

Firstly I like to present you my complete setup and layout of my setup dashboard.
But you don’t have to style the dashboard as I did. It’s completely configurable.

On desktop and tablets it can look like:

And on mobile:

My dashboard consists mainly out of two custom components which I created:
HA-Dashboard
https://github.com/wassy92x/lovelace-ha-dashboard

This plugin can be added as custom repository in HACS, but I also created a pull-request in the hacs-default-repsitories, so it will be soon available in default-HACS.
Update: Now available in HACS Default.

For configuration see my GitHub-Repository.

Entities-Button-Group
https://github.com/wassy92x/lovelace-entities-btn-group

This plugin can also be added as custom repository in HACS, but I also created a pull-request in the hacs-default-repsitories, so it will be soon available in default-HACS.
Update: Now available in HACS Default.

For configuration see my GitHub-Repository.

This Frontend-Plugin is also usable itslelf, without my dashboard.

Furthermore you need the following Plugings to get the dashboard as mine:

views:
  - title: Kiosk
    path: kiosk
    type: 'custom:ha-dashboard'
    sidebar:
      buttons:
        - icon: mdi:robot-vacuum
          action:
            action: call-service
            service: browser_mod.popup
            service_data:
              title: Xiaomi Roborock
              card:
                buttons: true
                entity: vacuum.roborock_vacuum_s5
                type: 'custom:xiaomi-vacuum-card'
      stickyCards:
        - type: 'custom:digital-clock'
          style: |
            ha-card {
              margin: 0 5px;
              border-radius: 0;
              border-bottom: 1px solid white;
            }
        - type: weather-forecast
          entity: weather.frankfurt_openweathermap
          style: |
            ha-card {
              padding-top: 0 !important;
              padding-bottom: 0 !important;
            }
      cards:
        - type: 'custom:auto-entities'
          card:
            type: entities
            title: Offene Fenster/Türen
          filter:
            include:
              - entity_id: binary_sensor.*_fensterkontakt*
                state: 'on'
          show_empty: false
          sort:
            method: entity_id
    cards:
      - type: 'custom:entities-btn-group'
        title: Wohnzimmer
        entities:
          - light.moritz
          - entity: climate.wohnzimmer_thermostat_int0000001
            variables:
              curTempEntity: sensor.wohnzimmer_temperatur
          - entity: media_player.firetv_wohnzimmer
            name: FireTV
      - type: 'custom:entities-btn-group'
        title: Küche
        entities:
          - entity: light.esstischlampe
          - entity: climate.kueche_thermostat
            variables:
              humidityEntity: sensor.kuche_feuchtigkeit
              curTempEntity: sensor.kuche_temperatur
          - entity: var.state_spulmaschine
            name: Spülmaschine
      - type: 'custom:entities-btn-group'
        title: Außen
        entities:
          - entity: switch.pool_warmwasserpumpe
            name: Warmwasser
          - template:
              - camera
            variables:
              pictureUrl: https://mycamera.com/weg
            name: Weg
title: Kiosk

Furthermore I have the following button templates to style the buttons:

button_card_templates:
  default:
    aspect_ratio: 1/1
    styles:
      card:
        - border-radius: 10px
        - box-shadow: none
        - transition: none
      name:
        - font-size: 0.8em
  light:
    template:
      - default
    custom_fields:
      brightness: >
        [[[ if (entity && entity.attributes && entity.attributes.brightness) {
        return Math.round(entity.attributes.brightness * (100 / 255)) + '%' }
        return '' ]]]
    styles:
      custom_fields:
        brightness:
          - position: absolute
          - right: 5px
          - top: 5px
          - font-size: 0.85em
    double_tap_action:
      action: call-service
      service: browser_mod.popup
      service_data:
        title: '[[[ return entity.attributes.friendly_name ]]]'
        card:
          type: 'custom:light-entity-card'
          entity: '[[[ return entity.entity_id ]]]'
  var:
    template:
      - default
    show_state: true
    styles:
      state:
        - bottom: calc(25% - 0.4em)
        - position: absolute
        - width: 100%
        - text-align: center
        - font-size: 0.8em
        - font-weight: bold
  media_player:
    template:
      - default
    show_entity_picture: true
    styles:
      entity_picture:
        - width: 95%
        - height: 100%
        - border-radius: 5px
  climate:
    template:
      - default
    show_icon: false
    show_state: true
    show_name: false
    tap_action:
      action: call-service
      service: browser_mod.popup
      service_data:
        title: '[[[ return entity.attributes.friendly_name ]]]'
        card:
          type: 'custom:simple-thermostat'
          entity: '[[[ return entity.entity_id ]]]'
          hide:
            temperature: '[[[ return variables && variables.curTempEntity ]]]'
          sensors:
            - entity: '[[[ return variables && variables.curTempEntity ]]]'
              name: Temperatur
            - entity: '[[[ return variables && variables.humidityEntity ]]]'
              name: Feuchtigkeit
          step_size: 0.5
    custom_fields:
      curTemp: >
        [[[ if (variables && variables.curTempEntity &&
        states[variables.curTempEntity]) { return
        (Math.round(states[variables.curTempEntity].state * 10) / 10) +
        states[variables.curTempEntity].attributes.unit_of_measurement } else if
        (entity && entity.attributes) { return
        (Math.round(entity.attributes.current_temperature * 10) / 10) + '°C' }
        return '' ]]]
      targetTemp: >
        [[[ if (entity && entity.attributes) { return
        entity.attributes.temperature + '°C' } return '' ]]]
      humidity: >
        [[[ if (variables && variables.humidityEntity &&
        states[variables.humidityEntity]) { return
        (Math.round(states[variables.humidityEntity].state * 10) / 10) +
        states[variables.humidityEntity].attributes.unit_of_measurement } return
        '' ]]]
    styles:
      state:
        - bottom: 5px
        - position: absolute
        - width: 100%
        - text-align: center
        - font-size: 0.8em
      custom_fields:
        curTemp:
          - position: absolute
          - left: 0
          - top: calc(50% - 0.6em)
          - width: 100%
          - font-size: 1.2em
        targetTemp:
          - position: absolute
          - right: 5px
          - top: 5px
          - font-size: 0.85em
        humidity:
          - position: absolute
          - left: 5px
          - top: 5px
          - font-size: 0.85em
  camera:
    template:
      - default
    show_entity_picture: true
    entity_picture: '[[[ return variables.pictureUrl ]]]'
    styles:
      entity_picture:
        - width: 95%
        - height: 100%
        - border-radius: 5px
    tap_action:
      action: url
      url_path: '[[[ return variables.pictureUrl ]]]'
7 Likes

First of all, thank you for your plugins!

I have a small issue, when i’m using your card there is something odd with the screen size. How can i manage that. The buttons on my tablet are to big.

Right size with a wider window size of my browser:

Wrong size with a smaller window size of my browser:

Hi @rolfberkenbosch
I will try to adjust the size of the buttons.
I think you like to have 3 buttons in one row.
The size respectively the number of buttons per row is currently based on the screensize.
If your screen is less than 1025px or bigger than 1599px there will be 3 buttons in one row otherwise there will be 2 buttons, because otherwise the buttons will be to small.

Could you provide me your screensize of your tablet (You can get it for example from the following website: http://howbigismybrowser.com/) and also your prefered style?

I tried to improve the responsiveness of the button group / buttons and released a new version.
Furthermore I added the possibility to change the layout. If you like to customize the layout, please visit my GitHub Repository of the Entities Button Group. (But it would be still good, if you could tell me your screen resolutiin)

I’d like to see more examples :slight_smile: and also who to use styes, as I’d like to have 3 icons on a row.

and one thing more, I you only find the git version, you need to include more code in the examples, e.g.:

 - type: 'custom:entities-btn-group'
        title: Küche
        entities:
          - entity: light.esstischlampe
          - entity: climate.kueche_thermostat
            variables:
              humidityEntity: sensor.kuche_feuchtigkeit
              curTempEntity: sensor.kuche_temperatur
          - entity: var.state_spulmaschine
            name: Spülmaschine

The climate is missing in the github example

Hi Michael,
I added some more examples (including screenshots) to the README.
You can change the number of items by setting the following css variables.
Therefore you have to create a new theme in your configuration.yaml
Please include the following setting:
entities-btn-group-grid-template: repeat(3, 1fr)

Now there will be three buttons in one row.
Maybe you have also to change entities-btn-group-item-max-width otherwise the buttons won’t get bigger than 125px.

Great add-on. Thank you. I was able to install it and get it running on the sidebar, and now I want to start customizing.

I have a few questions.

  1. Can I change the width of the sidebar?
  2. Can I easily replicate the sidebar on every tab? How do I do that?

I would like to do the same you have done, but instead of each room having a custom card, I want each room to have its own tab. I will then add buttons on the sidebar which will navigate to each of the tabs depending on what is pressed.

This is the configuration I am using. I copied the main ones from @wassy92x , and I am using a grid I created for navigation before I stumbled upon this add-on.
I didn’t use the buttons because they are small and end up at the bottom of the side bar. I would like to get the navigation buttons in a grid so I can control them.
Should I use the custom button card in my sidebar to accomplish the navigation?

views:
  - title: Home
    path: home
    icon: mdi:home-outline
    theme: Caule Black Orange
    type: custom:ha-dashboard
    visible:
      - user: xxxxxxxxxxxx
      - user: xxxxxxxxxxxx
    badges:
      - entity: person.haz
    button_card_templates:
      default:
        aspect_ratio: 1/1
        styles:
          card:
            - border-radius: 10px
            - box-shadow: none
            - transition: none
          name:
            - font-size: 0.8em
      light:
        template:
          - default
        custom_fields:
          brightness: >
            [[[ if (entity && entity.attributes && entity.attributes.brightness)
            { return Math.round(entity.attributes.brightness * (100 / 255)) +
            '%' } return '' ]]]
        styles:
          custom_fields:
            brightness:
              - position: absolute
              - right: 5px
              - top: 5px
              - font-size: 0.85em
        double_tap_action:
          action: call-service
          service: browser_mod.popup
          service_data:
            title: '[[[ return entity.attributes.friendly_name ]]]'
            card:
              type: custom:light-entity-card
              entity: '[[[ return entity.entity_id ]]]'
      var:
        template:
          - default
        show_state: true
        styles:
          state:
            - bottom: calc(25% - 0.4em)
            - position: absolute
            - width: 100%
            - text-align: center
            - font-size: 0.8em
            - font-weight: bold
      media_player:
        template:
          - default
        show_entity_picture: true
        styles:
          entity_picture:
            - width: 95%
            - height: 100%
            - border-radius: 5px
      climate:
        template:
          - default
        show_icon: false
        show_state: true
        show_name: false
        tap_action:
          action: call-service
          service: browser_mod.popup
          service_data:
            title: '[[[ return entity.attributes.friendly_name ]]]'
            card:
              type: custom:simple-thermostat
              entity: '[[[ return entity.entity_id ]]]'
              hide:
                temperature: '[[[ return variables && variables.curTempEntity ]]]'
              sensors:
                - entity: '[[[ return variables && variables.curTempEntity ]]]'
                  name: Temperatur
                - entity: '[[[ return variables && variables.humidityEntity ]]]'
                  name: Feuchtigkeit
              step_size: 0.5
        custom_fields:
          curTemp: >
            [[[ if (variables && variables.curTempEntity &&
            states[variables.curTempEntity]) { return
            (Math.round(states[variables.curTempEntity].state * 10) / 10) +
            states[variables.curTempEntity].attributes.unit_of_measurement }
            else if (entity && entity.attributes) { return
            (Math.round(entity.attributes.current_temperature * 10) / 10) + '°C'
            } return '' ]]]
          targetTemp: >
            [[[ if (entity && entity.attributes) { return
            entity.attributes.temperature + '°C' } return '' ]]]
          humidity: >
            [[[ if (variables && variables.humidityEntity &&
            states[variables.humidityEntity]) { return
            (Math.round(states[variables.humidityEntity].state * 10) / 10) +
            states[variables.humidityEntity].attributes.unit_of_measurement }
            return '' ]]]
        styles:
          state:
            - bottom: 5px
            - position: absolute
            - width: 100%
            - text-align: center
            - font-size: 0.8em
          custom_fields:
            curTemp:
              - position: absolute
              - left: 0
              - top: calc(50% - 0.6em)
              - width: 100%
              - font-size: 1.2em
            targetTemp:
              - position: absolute
              - right: 5px
              - top: 5px
              - font-size: 0.85em
            humidity:
              - position: absolute
              - left: 5px
              - top: 5px
              - font-size: 0.85em
      camera:
        template:
          - default
        show_entity_picture: true
        entity_picture: '[[[ return variables.pictureUrl ]]]'
        styles:
          entity_picture:
            - width: 95%
            - height: 100%
            - border-radius: 5px
        tap_action:
          action: url
          url_path: '[[[ return variables.pictureUrl ]]]'
    sidebar:
      stickyCards:
        - type: custom:simple-clock-card
          use_military: true
          hide_seconds: false
          font_size: 5rem
          padding_size: 40px
      cards:
        - type: grid
          cards:
            - type: custom:weather-card
              entity: weather.home_austin
              number_of_forecasts: '6'
              details: true
              forecast: true
              hourly_forecast: false
            - type: markdown
              content: >-
                <li>
                      {% if now().hour  < 5 %} Good Night {{'\U0001F634'}}
                      {% elif now().hour < 12 %} Good Morning{{'\u2615\uFE0F'}}
                      {% elif now().hour < 18 %} Good Day{{'\U0001F44B\U0001F3FB'}}
                      {% else %} Good Evening{{'\U0001F44B\U0001F3FB'}}{% endif %} {{user}}
                  </li>
                The **Markdown** card allows you to write any text. You can
                style it **bold**, *italicized*, ~strikethrough~ etc. You can do
                images, links, and more.

                For more information see the [Markdown
                Cheatsheet](https://commonmark.org/help).

                I will be putting a summary here which is noteworthy, like any
                lights on when no presence detected, etc...
            - type: grid
              cards:
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: /home-controls/0
                  icon: mdi:home-outline
                  hold_action:
                    action: none
                  name: HOUSE
                - type: button
                  tap_action:
                    action: toggle
                  icon: mdi:car-multiple
                  name: GALLERY
                - type: button
                  tap_action:
                    action: toggle
                  name: GUEST-HOUSE
                  icon: mdi:home-account
                - type: button
                  tap_action:
                    action: toggle
                  name: POOL
                  icon: mdi:pool
                - type: button
                  tap_action:
                    action: toggle
                  name: GARAGE
                  icon: mdi:garage
                - type: button
                  tap_action:
                    action: toggle
                  icon: mdi:train-car
                  name: CAR PORT
                - type: button
                  tap_action:
                    action: toggle
                  name: FRONTYARD
                  icon: mdi:leaf
                - type: button
                  tap_action:
                    action: toggle
                  name: BACKYARD
                  icon: mdi:leaf
              square: true
              columns: 4
            - type: markdown
              content: >-
                The **Markdown** card allows you to write any text. You can
                style it **bold**, *italicized*, ~strikethrough~ etc. You can do
                images, links, and more.


                For more information see the [Markdown
                Cheatsheet](https://commonmark.org/help).
            - type: grid
              cards:
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: ''
                  icon: mdi:lightbulb
                  show_state: true
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: ''
                  icon: mdi:motion-sensor
                  show_state: true
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: ''
                  icon: mdi:dip-switch
                  show_state: true
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: ''
                  entity: alarm_control_panel.xxx
                  show_name: false
                  show_state: true
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: ''
                  icon: mdi:view-carousel
                - type: button
                  tap_action:
                    action: navigate
                    navigation_path: ''
                  icon: mdi:table-settings
            - type: custom:fullscreen-card
          columns: 1
          square: false
    cards: []

@wassy92x in your custom brightness field you use if (entity && entity.attributes && entity.attributes.brightness). I use it too but I have no idea what it actually does. Why do all three need to be listed.? Could you or anyone explain or point me to the docs that explain it.? Thanks.

Thanks for this! Exactly what I was looking for :slight_smile:

Is there any way to change the color of the footer buttons from the default blue color? I want to use different colors for each button if possible (using templates to reflect statuses). But if that is not possible, at least would be good to be able to define color with something like…

    sidebar:
      buttons:
        - icon: mdi:shield-home
          icon_color: amber // something like this
          action:
            action: call-service
            service: service.here

Good card but lack of examples in doc unfortunately

I could not get a simples style working because docs only show you can apply, but where?
So confusing…
:confused:

Did you find a way how to change the width? it’s crazy, the default value is to small.

Does somebody know hot to make the Sidebar Transparent? :thinking:

Anyone cracked the code for these:

      styles: |
        .sidebar {
            --sidebar-min-width: 100px;
            --sidebar-max-width: 200px;
            --sidebar-background: red;
        }

I’ve tried all permutations I can think of and just can’t seem to get it to work

@wassy92x tagging you for help

1 Like

Try this:

    card_mod:
      style: |
        .sidebar {
          --sidebar-min-width: 200px;
          --sidebar-max-width: 320px;
          background: rgba(var(--rgb-card-background-color), 0.7) !important;

          box-shadow: none !important;
          border-radius: 0 !important;
          margin: -1px 50px -1px -1px !important;
        }

I have strange issue when using a theme that hides the navigation topbar (minimalist-mobile). At the bottom there is an indent from the edge of the screen that is superimposed on top of the elements including the sidebar!

изображение

Hey there, thanks for the awesome work of puting this together. I was able to create a great sidebar for my dashboard. A few comments though from my side:

  • Please be more clear on how to change the width of the sidebar. You are mentioning that there is an option to do so, but there is no further explanation as to where? Is it in the YAML, or directly on the .js resource?
  • The feature to hide the sidebar on smaller screens, although neat, it kind of cancel’s the existance of a sidebar alltogether. People, would like to put in their sidebars cards that they use all the time for easy access. If the sidebar get’s hidden below a certain resolution, people are loosing access to these cards. Therefore, my recommendation would be not to hide, but to come on top of the rest of the content.

If anyone has found out how to change the width of the sidebar i would be greatful if they could tell me!

Thanks
M

I found out how to change the width of the sidebar. You need to add the value in the theme you are using. I use Google Dark Theme and i added the following lines in the theme:

  # Sidebar size
  sidebar-relative-width: 25%

You can find your themes folder under config-> themes.

Also, in case you want to change the number of pixels that the sidebar dissapears you need to add this value to the dasboard yaml in the Raw Configuration Editor. Example:

views:
  - title: Desktop
    path: desktop
    background: center / cover no-repeat url("/local/background.jpg") fixed
    type: custom:ha-dashboard
    sidebar:
      screenMinWidth: 828
      cards:
        - type: weather-forecast
          entity: weather.forecast_home
...

Hope this helps
M

Anyone knows, if it’s possible to work with !include only in sidebar part and create the other in UI?

Since this layout and the layout-cards masonry integrations are fighting over screen time :slight_smile:
is it possible to configure a maximum amount of columns on the remainder of the page?

Who can help me, I’ve tried to copy this dashboard but I got this message after adjust the entries to my. I’m sorry but I’m newbie in HA.

I could not found any solution while use google this error message. Therefore I ask the pro’s here.