Introduction
The goal of this blog is to set up a cost effective solution to monitoring your pool water temperature in real time and visualize it in Home Assistant.
Hardware
To measure the temperature in water we need a waterproof probe of course and I found this one very cheap and very robust : DS18B20 (Dallas)
and of course a Wemos D1 (ESP)
Wiring
the wiring is very simple here :
Using ESPHome in Home Assistant
There are several possibilities to generate code to upload it on a ESP(wemos). I chose to use ESPHome in Home Assistant which is simple :
Go to the ESPHome add-on in Home Assistant and create your Secrets if it has not been done yet
Secret Creation
Now it's time to define the secrets in ESPHome by clickinbg on secrets in the upper right corner
Fill with you personnal wifi information :
Code
Now the code to send the this new device needs to be written to be able to measure the temperature of water in the pool
Let's click on the bottom right corner on + New Device :
Give it a name
Chose the device type
Then click on Install (this device doesn't exist anymore, the encryption key is RIP)
As I plugged this ESP on my Home Assistant I chose the following
Chose the correct port to intiate the communication
and when it's done, we can proceed to the upload of the code by clicking on Edit of this new ESP device
You can paste the following code as it is :
esphome:
name: pool-temp
platform: ESP8266
board: d1_mini
# WiFi connection, replace these with values for your WiFi.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable logging
logger:
# Enable Home Assistant API
api:
# Enable over-the-air updates.
ota:
# Enable Web server.
web_server:
port: 80
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
# DS18B20 Temperature Sensor
dallas:
- pin: D4
update_interval: 700s
sensor:
- platform: dallas
address: 0xd901192927c1d028
name: "Pool Temperature"
Then click on Install the I chose to do the install wirelessly since it's not plug to Home Assistant anymore
Waiting a bit and when it's done, distance begin to be measured (last lines)
Home Assistant integration
Once the ESP flashed we can add stuff in Home Assistant