Show dashboard on Dakboard

I have a Dakboard on which I show calendar, weather, energy consumption (DSMR reader, SolarEdge) etc). I recently configured the Energy dashboard in HA, and I love it.
So I’d like to show that particular dashboard on my Dakboard. Dakboard allows for retrieving an embedded URL. I have a Traefik reverse proxy that can be configured to allow Dakboard to fetch that page from ouside.
However… I have no clue on how to allow this in HA. I’m confused wrt users and how they can or cannot login or interact with the webinterface. I created a special dashboard, and created a special user, so when that user logs in, he gets the correct (trimmed down) energy dashboard.

But how do I go about removing the password from the user? I don’t see this as a security risk as the user is only allowed to view one single dashboard.

Same question here! Did you find a solution?

No, haven’t gotten round to find a solution. Sorry.

I tried and tried…
First I created a Long Lived Access token for my Dakboard user, but that can only be used to query the API (should have read the docs).
I then started looking at the authentication providers section. My HAS runs in Docker on a Pi. I also have a cloudflare tunnel setup in Docker (I ditched the Traffic reverse proxy) to allow external login to HAS. That works fine for the app and regular website access.

So I want to have the Dakboard user login automatically to a specific dashboard screen that I want (the Energy one).

  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 192.168.0.0/24
        - <my external IP>/32
      allow_bypass_login: true
      trusted_users:
        <my external IP>: userID
    - type: homeassistant

If I add the URL as an embedded URL block in the Dakboard GUI, I can login without password with user Dakboard ! This works fine and I even see the Energy dashboard in the Live View !! hurrah…

However… on my Dakboard screen itself, I only see a white screen with the Home assistant logo.

Guess I should better give up. Perhaps the construction with whitelisting my own public IP in the auth_providers section and the combination with Cloudflare Tunnel from the same host is a bit too complex me to understand and/or for HAS to handle.

Perhaps I should look in the trusted_proxies section for a solution ? That now has my Docker network configured (otherwise Cloudflare wouldn’t work).

Would love to hear a solution from someone to allow for external http login without providing username and password.

Hi Braham,

did you already find a solution? i am a littlbit a noob in on this topic
i came tot the same step with a white board color and homeassist logo…

I am showing some sensors on my dakboard for the time beein.

I’ve used a different approach. First of all, I don’t use the energy dashboard anymore. It appears it does not refresh automatically, so it’s useless to present as a dynamic dashboard.

I created a different dashboard, and made the layout so that it is a small banner (see screenshot below). The icons change color when they’re active (e.g. solar panels turn yellow when the sun is shining etc).

I added a nginx webserver to the Pi that is running Dakboard (I’m not running the Dakboard OS) and created a custom homepage (that is called when the Pi is booted).

<!DOCTYPE html>
<html><head>

<style>
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    background-color: black;
}

</style>
</head>
<body>

<iframe scrolling="no" id="top_frame" style="width: 1080px; height: 1760px;" src="https://dakboard.com/display/uuid/<<MYUUID>>" frameBorder="0">></iframe>
<iframe scrolling="no" id="bottom_frame" style="width: 1080px; height: 160px;" src="http://homeassistant.local:8123/lovelace/board?kiosk" frameBorder="0"></iframe>

</body></html>

That custom homepage has two iframes. The top one is showing Dakboard info (calendar, photos, weather etc). The bottom iframe is showing my home assistant info. It was a bit trail and error to make sure the two iframes played nicely together.

I’ve settled with that because it gives me all the info at one glance, without the need for two dashboard screens.

Nice and thanks for the inspiration. i think i am goin to make a visualisation (place it on dakboard) and project multible sensor data on the picture.
i understand the thing you have done but that is next level for me…

Have you guys tried to control dakboard (or the pi) from HA? I want to use a presence sensor to dim or turn on/off the screen?

I have set that up using MQTT and node-red. My Dakboard runs on a Pi with RaspOS (not the DakboardOS).

It’ll detect motion, send that info using HomeKit to a HA switch (my motion sensor is built-in a Eve camera that only speaks Homekit) that sends a MQTT message.

Node-red picks up that MQTT messages, activates a timer (turns screen off after 25 minutes) and sends it on to another MQTT topic.

On the Dakboard screen, the MQTT client will see the changes in the MQTT topic and then turn the screen on or off.

I’ll write it up tomorrow, a bit busy atm.

1 Like

That is cool! So im pretty much looking to do the same thing. My biggest thing was how to getting HA to talk to the Pi, If you can just mention what you’re using for that (if you have time to share config, awesome! but even that would be enough :slight_smile:

Im also looking at using fullpage OS for the browser, anyone have any experience with that? Do you just use the private URL from your Dakboard page?

Thanks

I got the inspiration and did a clean copy/paste of the python code located here: Controlling the Raspberry Pi HDMI port — with MQTT and Home Assistant :: Cavelab blog — Stories from the Cavelab

Perhaps there are simpler ways to do this, but I like MQTT. Step 1 and 2 might look different for you, depending on your motion sensor.

PS: switch is in Dutch, cause I’m Flemish. google translate to the rescue.

Step 1: create a switch, based on MQTT

Home assistant/configuration.yml

mqtt:
  switch:
    - name: "Keuken beweging"
      state_topic: "keuken/sensor/beweging"
      command_topic: "keuken/sensor/beweging"
      payload_off: 0
      payload_on: 1

Step 2: create homekit automation

In my Homekit, this switch is triggered through an automation.

Basically, between 6:30 am and 10:30 pm, it’ll detect presence in the kitchen ,where the Dakboard screen is located. I’m not interested in having my Dakboard/HA screen lit outside of those hours.

Step 3: node-red config

The payload (1 in case of movement) will be in MQTT, where Node-Red comes in. Node-Red actually only adds a timer (after 25 minutes send a “0”, unless movement is detected again), and passes the payload (0 or 1) on to another MQTT topic.


Trigger

Step 4: MQTT client and scripts on the Dakboard/HA kiosk screen

This is based on Raspberry Bullseye, so perhaps it might be different with latest Debian version.

On the Pi, a python script was created that powers the screen off or on. This script is made into a system service, that refreshes every 60 seconds.

mqtt.py

import paho.mqtt.client as mqtt
import time
import subprocess

# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, flags, rc):
    print("Connected with result code " + str(rc))

    # Subscribing in on_connect() means that if we lose the connection and
    # reconnect then subscriptions will be renewed.
    client.subscribe("rpi-board/screen/set")

# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
    print(msg.topic + " " + str(msg.payload.decode('utf-8')))
    subprocess.run(["vcgencmd", "display_power", str(msg.payload.decode('utf-8'))])
    client.publish("rpi-board/screen", get_screen_status())

# Return the state of the HDMI port power
def get_screen_status():
    status = subprocess.run(["vcgencmd", "display_power"], stdout=subprocess.PIPE, text=True)
    status_b = status.stdout.split("=")[1].strip()
    return status_b

client = mqtt.Client("rpi-board")
client.username_pw_set("mqtt", "<password>")
client.on_connect = on_connect
client.on_message = on_message
client.connect("hassio-mqtt.lan")
client.loop_start()

while True:
    client.publish("rpi-board/screen", get_screen_status())
    time.sleep(60)

The system service located in /lib/systemd/system/mqtt_status.service

[Unit]
Description=MQTT status
After=multi-user.target
#Wants=network.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/pi/mqtt.py
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

And that’s it.

I don’t use Fullpage OS, just plain old Debian Bullseye with custom startup script (see post above), and yes, the iFrame points to private Dakboard URL

1 Like

LOL, absolutely!

Thank you so much for putting all the effort in to write that out! Im sure it other people will get something out of it as well :slight_smile: But that really helps.

Ill give it a go tonight and hopefully have no other questions HAHA :slight_smile:

Thank again for that

Actually I do have a question already LOL, how fast does it respond to the sensor as a guess?

Ok, so Im clealy not doing this right lol

I have this set up, maybe im doing it wrong.

I have the switch and its setting the things

image

0 or 1

But the screen does nothing. I think I installed the

# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, flags, rc):
    print("Connected with result code " + str(rc))

    # Subscribing in on_connect() means that if we lose the connection and
    # reconnect then subscriptions will be renewed.
    client.subscribe("rpi-board/screen/set")

# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
    print(msg.topic + " " + str(msg.payload.decode('utf-8')))
    subprocess.run(["vcgencmd", "display_power", str(msg.payload.decode('utf-8'))])
    client.publish("rpi-board/screen", get_screen_status())

# Return the state of the HDMI port power
def get_screen_status():
    status = subprocess.run(["vcgencmd", "display_power"], stdout=subprocess.PIPE, text=True)
    status_b = status.stdout.split("=")[1].strip()
    return status_b

client = mqtt.Client("rpi-board")

But when I check the service logs, I get this;

Feb 24 21:02:58 kitchen python3[275996]: vc_gencmd_read_response returned -1
Feb 24 21:02:58 kitchen python3[275996]: error=1 error_msg="Command not registered"

too bad, you got that far already :slight_smile:

what OS are you running on the Pi ? what version of vcgencmd ? what is the output of following command ?

vcgencmd version

Looks like vcgencmd wants to use a command that is not supported. More info on vcgencmd can be found here

I suggest you try to use the vcgencmd in the command line first to test things.

This gives current power status for the display

 vcgencmd display_power

Ive got a Pi 5, running Bookworm.

Running the command on its own gives the same error.

vc_gencmd_read_response returned -1
error=1 error_msg="Command not registered"

It looks like one of the many bookworm/ Rasberry Pi 5 things that dont work :frowning:

Just to add though, all your stuff… works great! SO thanks for that :slight_smile:

Mine runs on a Raspberry Pi 3 Model B, and I don’t have a Pi 5 lying around I’m afraid.

If I’m not mistaken videocore is not used anymore on Pi 5, so that’s why the command is useless :frowning:

Have you checked doing this with cec-utils (Using HDMI-CEC on a Raspberry Pi - Pi My Life Up) ?

I’m afraid you’ll have to google it. Other suggestions are here How to Turn Off the HDMI Monitor on Your Raspberry Pi 5. It's Not As Easy as You Might Think - LowEndBox or MM current version on Raspberry Pi 5 cannot turn off monitor | MagicMirror Forum (similar issue)

1 Like

Its taken a while to figure out, but I got it working with DakOS in the end :slight_smile:

Works great :slight_smile:

Thanks for all the advice

Are you saying that you got Dakboard able to run in HA dashboards? If so can you share some more details?

Thats the easy part :wink:

Make a Dakboard button to your HA instance.

image

Then add a link back to your Dakboard screen in HA

Im using the custom button card, you do you :slight_smile: