Browse Source

Add ESPhome implementation to integrate with home assistant

master
Elis Hirwing 11 months ago
parent
commit
989e428cca
Signed by: etu <elis@hirwing.se> GPG Key ID: D57EFA625C9A925F
4 changed files with 49 additions and 0 deletions
  1. +10
    -0
      esphome/.gitignore
  2. +4
    -0
      esphome/README.org
  3. +4
    -0
      esphome/secrets.yaml
  4. +31
    -0
      esphome/watersensor.yaml

+ 10
- 0
esphome/.gitignore View File

@@ -0,0 +1,10 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
**/.pioenvs/
**/.piolibdeps/
**/lib/
**/src/
**/platformio.ini
/secrets.yaml

+ 4
- 0
esphome/README.org View File

@@ -0,0 +1,4 @@
* Building and installing on NodeMCU
#+BEGIN_SRC sh
esphome watersensor.yaml run
#+END_SRC

+ 4
- 0
esphome/secrets.yaml View File

@@ -0,0 +1,4 @@
wifi_ssid: <ssid>
wifi_password: <psk>
api_password: <api-password>
ota_password: <ota-password>

+ 31
- 0
esphome/watersensor.yaml View File

@@ -0,0 +1,31 @@
esphome:
name: livingroom_watersensor1
platform: ESP8266
board: nodemcu

# Set up Wifi
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

# Enable logging
logger:

# Enable Home Assistant API
api:
password: !secret api_password

# Enable OTA updates
ota:
password: !secret ota_password

# Configure ADC to read moisture data and output percentage
sensor:
- platform: adc
pin: A0
name: "Chilli Moisture Sensor"
filters:
- calibrate_linear:
- 0.30 -> 100.00
- 0.90 -> 0.00
update_interval: 60s

Loading…
Cancel
Save