Zigbee Home Automation - Visualisation

The visualisation is very deeply hidden and only visible to admin users - it would be useful to expose this element on the Overview dashboard and make it possible to display it elsewhere.

You can add it to the side bar with panel-redirect.

1 Like

This could be a Documentation Request :slight_smile:

I got it from somebody’s post. My configuration.yaml is:

frontend:

# Zigbee network map -----------------------------------------------------------

  - name: panel-redirect
  
# url_path needs to be unique for each panel_custom config

    url_path: redirect-zigbee
    sidebar_title: Zigbee network
    sidebar_icon: mdi:chart-bubble
    module_url: /local/panel-redirect.js

# Where you want to redirect to             

    config:
      target: config/zha/visualization

But it was a while ago - I can’t remember how it works… :thinking:

1 Like

Ah… It’s coming back to me now - it’s a custom thing. You also have to put a file called panel-redirect.js in your www folder. It should contain this:

/*
Add a link to the sidebar to any path in Home Assistant
Put this file in <config>/www/panel-redirect.js
In configuration.yaml:
panel_custom:
  - name: panel-redirect
    # url_path needs to be unique for each panel_custom config
    url_path: redirect-server-controls
    sidebar_title: Server Controls
    sidebar_icon: mdi:server
    module_url: /local/panel-redirect.js
    config:
      # Where you want to redirect to
      target: /config/server_control
*/
class PanelRedirect extends HTMLElement {
  connectedCallback() {
    if (this._info) {
      this._navigate();
    }
  }

  set panel(info) {
    this._info = info;

    if (this.isConnected) {
      this._navigate();
    }
  }

  _navigate() {
    history.replaceState(null, "", this._info.config.target);
    const event = new Event("location-changed", {
      bubbles: true,
      composed: true,
    });
    event.detail = { replace: true };
    this.dispatchEvent(event);
  }
}

customElements.define("panel-redirect", PanelRedirect);

You can put a button in the toolbar for any of the system dashboards - I have several: automations, scripts, helpers, logs…

Edit: I’ve created a short community guide for anyone who’s interested, but it says pretty much the same thing as above.

2 Likes