weather station esphome and others

This commit is contained in:
root
2024-05-27 22:20:04 +12:00
parent 945177d535
commit 155725ba3a
32 changed files with 4341 additions and 182 deletions

View File

@@ -1,75 +1,117 @@
#############################################
#############################################
# OVEN POWER MONITOR
# Monitoring power of an oven (at the main
# switchboard) using a sonoff basic (esp8266)
# and a PZEM-004T. The relay also allows disabling
# of the oven with a contactor (eg on smoke detection)
# https://zorruno.com/2022/nodered-oven-notifications/
##############################################
#############################################
#############################################
# Variable Substitutions
#############################################
substitutions:
devicename: "esp-mainovenmonitor"
friendly_name: "esp-mainovenmonitor"
description_comment: "Oven power monitoring and disable, with a sonoff basic"
api_key: !secret esp-mainovenmonitor_api_key #unfortunately you can't use substitutions in secrets names
ota_pass: !secret esp-mainovenmonitor_ota_pass #unfortunately you can't use substitutions in secrets names
mqtt_topic: "esphome" #main topic for the mqtt server, call it what you like
#update_time: 30s #update time for for temp sensors etc
#############################################
# ESPHome
#############################################
esphome:
name: "esp-mainovenmonitor"
name: ${devicename}
comment: ${description_comment} #appears on the esphome page in HA
#############################################
# Specific board for ESPHome device
#############################################
#############################################
# ESP Platform and Framework
# https://esphome.io/components/esp8266.html
# https://esphome.io/components/esp32.html
#############################################
esp8266:
board: sonoff_basic
#board: sonoff_basic
#board: esp01_1m
board: esp8285
framework:
version: latest #recommended, latest or dev
#esp32:
# board: nodemcu-32s
# framework:
# type: arduino
# #type: esp-idf #Suggested Use ESP-IDF Framework, or Plug Out the UART Cable Might Cause ESP32 Hang.
# version: recommended #recommended, latest or dev
#############################################
# ESPHome Logging Enable
# https://esphome.io/components/logger.html
#############################################
# NOTE: Baudrate set to 0 as we are using the UART with PZEM
logger:
baud_rate: 0
level: INFO #INFO Level suggested, or DEBUG for testing
baud_rate: 0 #set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM)
#esp8266_store_log_strings_in_flash: false
#tx_buffer_size: 64
#############################################
# Enable the Home Assistant API
# https://esphome.io/components/api.html
#############################################
api:
encryption:
key: !secret esp-mainovenmonitor_api_key
key: ${api_key}
#############################################
# Enable Over the Air Update Capability
# Safe mode will detect boot loops
# https://esphome.io/components/ota.html?highlight=ota
#############################################
ota:
safe_mode: true
password: !secret esp-mainovenmonitor_ota_pass
safe_mode: true #Safe mode will detect boot loops
password: ${ota_pass}
#############################################
# Use Wifi
# Wifi Settings
# https://esphome.io/components/wifi.html
#############################################
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Details for fallback hotspot (captive portal)
# in case wifi connection fails
ap:
ssid: "Mainovenmonitor Fallback Hotspot"
#power_save_mode: LIGHT #https://esphome.io/components/wifi.html#wifi-power-save-mode
#manual_ip: #optional static IP address
#static_ip: 192.168.x.x
#gateway: 192.168.X.x
#subnet: 255.255.255.0
ap: #Details for fallback hotspot (captive portal) in case wifi connection fails https://esphome.io/components/wifi.html#access-point-mode
ssid: $devicename fallback AP
password: !secret fallback_ap_password
# manual_ip:
# static_ip: 192.168.x.x
# gateway: 192.168.X.x
# subnet: 255.255.255.0
#############################################
# Fallback captive portal
#############################################
captive_portal:
ap_timeout: 5min #default is 1min
captive_portal: # Fallback captive portal https://esphome.io/components/captive_portal.html
#############################################
# Web Portal for display and monitoring
#############################################
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
version: 2
include_internal: true
ota: false
# auth:
# username: !secret web_server_username
# password: !secret web_server_password
#############################################
#############################################
# MQTT Monitoring
#############################################
# https://esphome.io/components/mqtt.html?highlight=mqtt
# MUST also have api enabled if you enable MQTT
#############################################
mqtt:
broker: !secret mqtt_server
topic_prefix: esphome/esp-mainovenmonitor
username: !secret mqtt_username
password: !secret mqtt_password
topic_prefix: ${mqtt_topic}/${devicename}
#username: !secret mqtt_username
#password: !secret mqtt_password
#############################################
@@ -116,9 +158,9 @@ switch:
name: "Main Oven Disable"
pin: GPIO12
#button:
# - platform: restart
# name: "Main Oven ESPHome Restart"
button:
- platform: restart
name: "Main Oven ESPHome Restart"
# LED Flashes on errors or warnings