ESPHome: Connect and Query DS18B20 to ESP32

Boot the ESP32 first only with the one_wire config and note down the hardware address from the DS18B20. Then add the second part of the yaml (see below) to monitor the DS18B20.

YAML
esphome:
  name: esp-temp
  friendly_name: esp-temp

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxx"

ota:
  - platform: esphome
    password: "xxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-Temp Fallback Hotspot"
    password: "xxxxxxxxxx"

captive_portal:

# <<<<<<<<< add thsi part to get the hardware adress from the DS18B20 >>>>>>>>>

one_wire:
 - id: bus_one
   platform: gpio
   pin:
    number: 4
    mode:
      input: true
      pullup: true

# <<<<<<<<< add this part after the first boot >>>>>>>>>
sensor:
  - platform: dallas_temp
    address: 0xe200000039xxxxxx
    name: "temp1"
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 2
  - platform: dallas_temp
    address: 0xf400000035xxxxxx
    name: "temp2"
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 2
  - platform: dallas_temp
    address: 0x6600000034xxxxxx
    name: "temp3"
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 2
  - platform: dallas_temp
    address: 0xf000000034xxxxxx
    name: "temp4"
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 2
  - platform: dallas_temp
    address: 0x5100000035xxxxxx
    name: "temp5"
    unit_of_measurement: "°C"
    icon: "mdi:thermometer"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 2

Connect Home Assistant with an external InfluxDB (v2)

I assume that the InfluxDB is already running.

Create a bucket and create an API token:

  1. load data, buckets, create bucket.
  2. API Tokens, Generate API Tokens, Custom API token. A ReadOnly token for the new bucket is sufficient here.

Create database connection in Home Assistant.

We store the InfluxDB-Config in a separate .yaml file. This keeps the configuration.yaml somewhat clearer.

We add the following to configuration.yaml:

configuration.yaml
influxdb: !include influxdb.yaml
Continue reading “Connect Home Assistant with an external InfluxDB (v2)”

Unifi Site-to-Site-VPN with Wireguard

This article describes how to establish a Site 2 Site connection with Unifi components from Ubiquiti via Wireguard. As of now (12.2024), the VPN connection must be added manually. However, there no access to the console via SSH is necessary.

Network overview

IP VPN-Gateway and
Site 0  (010-RAT)     10.11.0.1
--------------------------------
Site 1  (011-LST)     10.11.0.2

################################

Networks Site 0 (VPN Server)
10.10.60.0/24
--------------------------------
Netwokrs Site 1
10.0.200.0/24
Markdown
Continue reading “Unifi Site-to-Site-VPN with Wireguard”