We have a Dakboard digital calendar in our kitchen — showing lots of house and temperature data. So naturally; it must show the actual outdoor temperature as well.

To do this I used a Raspberry Pi 2, and a DS18B20 HAT I made some years back.

Table of contents

Raspberry Pi and DS18B20

First; A quick recap on the Raspberry Pi and DS18B20 sensor probe. On the Raspberry Pi — I:

  • Added a new user, and deleted the default user pi
  • Installed all updates and set the time zone
  • Install Supervisor, Vim, Git, and python3-pip
  • Installed Python libraries for MQTT and 1-wire sensor
  • Enable 1-wire communication with raspi-config
$ sudo userdel -r pi
$ sudo apt update && sudo apt upgrade
$ sudo dpkg-reconfigure tzdata
$ sudo apt install supervisor vim git python3-pip

$ sudo apt install python3-paho-mqtt
$ sudo pip3 install w1thermsensor

$ sudo raspi-config
On new Raspberry Pi OS images, the default user is disabled by default.

The connected DS18B20 sensor(s) will be listed under /sys/bus/w1/devices/:

$ ls /sys/bus/w1/devices/
28-051702869eff  w1_bus_master1

To view the raw temperature data:

$ cat /sys/bus/w1/devices/28-051702869eff/w1_slave
9a ff 4b 46 7f ff 0c 10 a4 : crc=a4 YES
9a ff 4b 46 7f ff 0c 10 a4 t=-6375

-6375 = -6.375°C

The HAT (Hardware Attached on Top)

The sensor probe interface HAT is well documented in my previous blog post, so I won’t go into too much details here. But here is how it looks, and the schematic diagram.

Raspberry Pi DS18B20 HAT

Schematic diagram

The diagram shows multiple temperature sensors, all connected to the data line. I’m just using one for this project.

Schematic diagram for DS18B20 HAT

Mounting in the garage

The temperature sensor is mounted under the roof, on a North facing wall on the garage. Quite protected from the weather and the sun. I was able to fit the wire through a small opening in the soffit.

Temperature probe on garage

The garage network cabinet is just on the other side of the wall — and has the Raspberry Pi inside, connected to, and powered by, the garage PoE switch.

Raspberry Pi in network cabinet
Raspberry Pi and PoE switch

Home Assistant

In Home Assistant; the temperature is displayed on the outdoor dashboard. The humidity is collected from the Met.no integration.

The temperature and humidity is fed into Thermal Comfort to calculate the absolute humidity, dew point and frost risk.

Screenshot of Home Assistant card
Screenshot of temperature graph — from Home Assistant

Sensor configuration

The sensor is manually defined in the Home Assistant configuration:

mqtt:
  sensor:
    - state_topic: 'sensor/rpi-temp/garage_outside'
      name: 'Garage outside temperature'
      unit_of_measurement: '°C'
      state_class: 'measurement'

Dakboard

And last, but not least, getting this temperature onto the Dakboard digital calendar in our kitchen. Using an External data/JSON block, and the Home Assistant API URL:

https://my.home-assistant.url/api/states/sensor.garage_outside_temperature

I’ve written in detail about external data in Dakboard in an earlier blog post:

Screenshot of Dakboard external data block

And voilà! The actual outdoor temperature, measured outside the garage, shown on the monitor in the kitchen 😃

Dakboard digital calendar

🖖