changes to esphome devices and packages to start removing node red dependencies
This commit is contained in:
+70
-10
@@ -6,6 +6,7 @@
|
||||
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-laundryenv.yaml
|
||||
#:########################################################################################:#
|
||||
# VERSIONS:
|
||||
# V1.2 2026-04-25 Added PIR MQTT light timer control, updated notes, added PIR debounce filters
|
||||
# V1.1 2026-03-11 Updated yaml to zorruno layout V1.1
|
||||
# V1.0 2025-03-28 Initial Version
|
||||
#:########################################################################################:#
|
||||
@@ -21,21 +22,36 @@
|
||||
# - Provides laundry temperature and humidity monitoring
|
||||
# - Provides a PIR motion binary sensor
|
||||
# - Provides a smoke detector binary sensor
|
||||
# - Designed as a simple environmental and safety monitoring node
|
||||
# - No relay or timed control logic is used in this yaml
|
||||
# - PIR Detected publishes an MQTT On command to the Laundry Lights device
|
||||
# - PIR Clear publishes an MQTT timer payload to the Laundry Lights device
|
||||
# - The Laundry Lights device performs the actual relay control and timer countdown
|
||||
# - The remote timer payload is in seconds and should match the accepted range on the light switch
|
||||
# - This device does not directly control a relay
|
||||
#:########################################################################################:#
|
||||
# MQTT COMMANDS:
|
||||
# - Remote light command topic:
|
||||
# - ${mqtt_remote_device1_command_topic}
|
||||
# - PIR Detected sends:
|
||||
# - ${mqtt_remote_device1_command1}
|
||||
# - PIR Clear sends:
|
||||
# - ${mqtt_remote_device1_command2}
|
||||
# - The timer payload is in seconds
|
||||
#:########################################################################################:#
|
||||
# OFFLINE NOTES:
|
||||
# a) Home Assistant offline (network and MQTT online):
|
||||
# - Device continues to read and publish local sensor states
|
||||
# - PIR, smoke, temperature, and humidity sensing continue locally
|
||||
# - PIR MQTT light control continues if the MQTT broker and target device are online
|
||||
#
|
||||
# b) MQTT offline (or HA/MQTT offline):
|
||||
# - Device continues sampling sensors locally
|
||||
# - No MQTT-based status publishing will be available
|
||||
# - PIR, smoke, temperature, and humidity sensing continue locally
|
||||
# - PIR MQTT light control is unavailable
|
||||
#
|
||||
# c) Entire WiFi/Network offline:
|
||||
# - Device continues sampling sensors locally
|
||||
# - No HA or MQTT connectivity will be available
|
||||
# - PIR MQTT light control is unavailable
|
||||
# - Accurate time is not needed; SNTP is not required for operation
|
||||
#:########################################################################################:#
|
||||
|
||||
@@ -53,20 +69,32 @@ substitutions:
|
||||
|
||||
# Project Naming
|
||||
project_name: "Sonoff Technologies.Sonoff DEV"
|
||||
project_version: "v1.1"
|
||||
|
||||
# Entity Naming
|
||||
entity_prefix: "Laundry"
|
||||
project_version: "v1.2"
|
||||
|
||||
# Passwords and Secrets
|
||||
api_key: !secret esp-laundryenv_api_key
|
||||
ota_pass: !secret esp-laundryenv_ota_pass
|
||||
static_ip_address: !secret esp-laundryenv_ip
|
||||
mqtt_command_main_topic: !secret mqtt_command_main_topic
|
||||
mqtt_status_main_topic: !secret mqtt_status_main_topic
|
||||
|
||||
# If we are changing IP addresses, you must update the current IP address here, otherwise it remains.
|
||||
# Don't forget to switch it back when changed.
|
||||
current_ip_address: ${static_ip_address}
|
||||
|
||||
# Device Settings
|
||||
log_level: "INFO"
|
||||
update_interval: "60s"
|
||||
entity_prefix: "Laundry"
|
||||
|
||||
# Remote light timer payloads, in seconds.
|
||||
remote_timer_lights_payload: "120"
|
||||
|
||||
# MQTT REMOTE Controls
|
||||
mqtt_remote_device1_name: "laundry-lights"
|
||||
mqtt_remote_device1_command_topic: "${mqtt_command_main_topic}/${mqtt_remote_device1_name}"
|
||||
mqtt_remote_device1_command1: "On"
|
||||
mqtt_remote_device1_command2: "${remote_timer_lights_payload}"
|
||||
|
||||
#:########################################################################################:#
|
||||
# PACKAGES:
|
||||
@@ -153,12 +181,37 @@ sensor:
|
||||
name: "${entity_prefix} Humidity"
|
||||
update_interval: "${update_interval}"
|
||||
|
||||
#:########################################################################################:#
|
||||
# SCRIPT COMPONENT:
|
||||
# MQTT commands sent to the remote Laundry Lights device
|
||||
# https://esphome.io/components/script.html
|
||||
#:########################################################################################:#
|
||||
script:
|
||||
- id: send_remote_light_on_commands
|
||||
mode: restart
|
||||
then:
|
||||
- mqtt.publish:
|
||||
topic: "${mqtt_remote_device1_command_topic}"
|
||||
payload: "${mqtt_remote_device1_command1}"
|
||||
qos: 0
|
||||
retain: false
|
||||
|
||||
- id: send_remote_light_timer_commands
|
||||
mode: restart
|
||||
then:
|
||||
- mqtt.publish:
|
||||
topic: "${mqtt_remote_device1_command_topic}"
|
||||
payload: "${mqtt_remote_device1_command2}"
|
||||
qos: 0
|
||||
retain: false
|
||||
|
||||
#:########################################################################################:#
|
||||
# BINARY SENSORS:
|
||||
# https://esphome.io/components/binary_sensor/
|
||||
#:########################################################################################:#
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
id: laundry_pir
|
||||
pin:
|
||||
number: GPIO13
|
||||
mode:
|
||||
@@ -166,14 +219,21 @@ binary_sensor:
|
||||
pullup: false
|
||||
name: "${entity_prefix} PIR"
|
||||
device_class: motion
|
||||
#filters:
|
||||
# - invert:
|
||||
filters:
|
||||
- delayed_on: 100ms
|
||||
- delayed_off: 1s
|
||||
on_press:
|
||||
- script.execute: send_remote_light_on_commands
|
||||
on_release:
|
||||
- script.execute: send_remote_light_timer_commands
|
||||
|
||||
- platform: gpio
|
||||
id: laundry_smoke_detector
|
||||
pin:
|
||||
number: GPIO5
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "${entity_prefix} Smoke Detector"
|
||||
name: "${entity_prefix} Smoke Detector"
|
||||
device_class: smoke
|
||||
Reference in New Issue
Block a user