Backup of latest home assistant scripts

This commit is contained in:
2024-11-10 10:31:10 +01:00
parent 8224226483
commit 5785a98d1c
8 changed files with 409 additions and 13 deletions

24
esp8266-test.yaml Normal file
View File

@@ -0,0 +1,24 @@
esphome:
name: esp8266-test
platform: ESP8266
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "48f8d0884bc08dc53e56c299a9783401"
wifi:
ssid: "EasyBox-368239"
password: "inginf95"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp8266-Test Fallback Hotspot"
password: "HFW1pCVNECIu"
captive_portal:

120
esphome-heatingsystem.yaml Normal file
View File

@@ -0,0 +1,120 @@
esphome:
name: esphome-heatingsystem
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
on_boot:
- switch.turn_on: relay
- light.turn_on: led
- switch.turn_on: fakebutton
mqtt:
broker: 192.168.178.36
port: 1884
username: nils
password: inginf95
on_message:
topic: esphome-heatingsystem/restart
qos: 0
then:
- switch.turn_off: relay
# Enable logging
logger:
hardware_uart: UART1
# Enable Home Assistant API
#api:
web_server:
port: 80
auth:
username: nils
password: inginf95
ota:
password: "0848c056d780accd7fbb0dbaf989156b"
wifi:
ssid: "EasyBox-368239"
password: "inginf95"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Sonoff-Basic-Test"
password: "Wky9j6BNCgI0"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff Basic Button"
on_press:
- switch.toggle: fakebutton
switch:
- platform: template
name: "Sonoff Basic Relay"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
- platform: gpio
id: relay
pin: GPIO12
name: "Heating System Relay"
on_turn_off:
- delay: 2500ms
- switch.turn_on: relay
output:
- platform: esp8266_pwm
id: basic_green_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff Basic Green LED"
output: basic_green_led
id: led
sensor:
- platform: wifi_signal
name: "Sonoff Basic WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Sonoff Basic Uptime"
- platform: dallas
address: 0x4F01204FEB52A128
name: "Test Sensor Temperature"
filters:
- filter_out: nan
- platform: dallas
address: 0x1901204FFD99B328
name: "Test Sensor2 Temperature"
filters:
- filter_out: nan
- platform: dallas
address: 0x9001204EFDB37828
name: "Test Sensor3 Temperature"
filters:
- filter_out: nan
dallas:
- pin: GPIO1
update_interval: 30s
text_sensor:
- platform: version
name: "Sonoff Basic ESPHome Version"

View File

@@ -40,7 +40,7 @@ switch:
sensor:
- platform: mqtt_subscribe
name: "Temperatur B<EFBFBD>ro"
name: "Temperatur Büro"
id: DachTemperatur
topic: stat/Dach/MA/temperature
- platform: wifi_signal

View File

@@ -65,7 +65,7 @@ globals:
#2 = closed, assume the garage is closed
mqtt:
broker: 192.168.178.76
broker: 192.168.178.36
port: 1884
username: nils
password: inginf95
@@ -94,7 +94,7 @@ text_sensor:
then:
- mqtt.publish:
topic: stat/Garage/status
payload: "Garage soll ge<EFBFBD>ffnet werden"
payload: "Garage soll geöffnet werden"
- if:
condition:
lambda: 'return (id(GarageStatus)==2);'

View File

@@ -45,7 +45,7 @@ switch:
mqtt:
broker: 192.168.178.76
broker: 192.168.178.36
port: 1884
username: nils
password: inginf95
@@ -55,7 +55,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK1).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK1).state);'
then:
- logger.log: "Turn on vent 1!"
- switch.turn_on: vent1
@@ -72,7 +72,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK2).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK2).state);'
then:
- logger.log: "Turn on vent 2!"
- switch.turn_on: vent2
@@ -89,7 +89,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK3).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK3).state);'
then:
- logger.log: "Turn on vent 3!"
- switch.turn_on: vent3
@@ -106,7 +106,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK4).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK4).state);'
then:
- logger.log: "Turn on vent 4!"
- switch.turn_on: vent4

View File

@@ -45,7 +45,7 @@ switch:
mqtt:
broker: 192.168.178.76
broker: 192.168.178.36
port: 1884
username: nils
password: inginf95
@@ -55,7 +55,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK1).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK1).state);'
then:
- logger.log: "Turn on vent 1!"
- switch.turn_on: vent1
@@ -72,7 +72,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK2).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK2).state);'
then:
- logger.log: "Turn on vent 2!"
- switch.turn_on: vent2
@@ -89,7 +89,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK3).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK3).state);'
then:
- logger.log: "Turn on vent 3!"
- switch.turn_on: vent3
@@ -106,7 +106,7 @@ mqtt:
then:
- if:
condition:
lambda: 'return (esphome::parse_float(x)) < (id(TargetHK4).state);'
lambda: 'return (esphome::parse_number<float>(x)) < (id(TargetHK4).state);'
then:
- logger.log: "Turn on vent 4!"
- switch.turn_on: vent4

125
sonoff-3x-wohnzimmer.yaml Normal file
View File

@@ -0,0 +1,125 @@
esphome:
name: sonoff-3x-wohnzimmer
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
mqtt:
broker: 192.168.178.36
port: 1884
username: nils
password: inginf95
on_message:
- topic: sonoff-3x-wohnzimmer/relay1
payload: "on"
then:
- switch.turn_on: relay
- topic: sonoff-3x-wohnzimmer/relay1
payload: "off"
then:
- switch.turn_off: relay
- topic: sonoff-3x-wohnzimmer/relay2
payload: "on"
then:
- switch.turn_on: relay2
- topic: sonoff-3x-wohnzimmer/relay2
payload: "off"
then:
- switch.turn_off: relay2
- topic: sonoff-3x-wohnzimmer/relay3
payload: "on"
then:
- switch.turn_on: relay3
- topic: sonoff-3x-wohnzimmer/relay3
payload: "off"
then:
- switch.turn_off: relay3
# Disable logging
logger:
baud_rate: 0
# Enable Home Assistant API
#api:
web_server:
port: 80
auth:
username: nils
password: inginf95
ota:
password: "0848c056d780accd7fbb0dbaf989156b"
wifi:
ssid: "EasyBox-368239_WZ"
password: "inginf95"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Sonoff-3x-Wohnzimmer"
password: "Wky9j6BNCgI0"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff Basic Button"
on_press:
- switch.toggle: fakebutton
switch:
- platform: template
name: "Sonoff Basic Relay"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
- platform: gpio
name: "Relay1"
id: relay
pin: GPIO12
- platform: gpio
name: "Relay2"
id: relay2
pin:
number: GPIO1
- platform: gpio
id: relay3
name: "Relay3"
pin:
number: GPIO3
output:
- platform: esp8266_pwm
id: basic_green_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff Basic Green LED"
output: basic_green_led
id: led
sensor:
- platform: wifi_signal
name: "Sonoff Basic WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Sonoff Basic Uptime"
text_sensor:
- platform: version
name: "Sonoff Basic ESPHome Version"

127
sonoff-arduino-bridge.yaml Normal file
View File

@@ -0,0 +1,127 @@
esphome:
name: sonoff-arduino-bridge
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
includes:
- uart_read_line_sensor.h
mqtt:
broker: 192.168.178.36
port: 1884
username: nils
password: inginf95
on_message:
- topic: sonoff-arduino-bridge/cmnd
qos: 0
then:
- uart.write: !lambda |-
std::vector<unsigned char> data(x.begin(), x.end());
return data;
- topic: sonoff-arduino-bridge/pc-on
qos: 0
then:
- uart.write: "OPTO1=ON\r"
- delay: 2s
- uart.write: "OPTO1=OFF\r"
- topic: sonoff-arduino-bridge/pc-off
qos: 0
then:
- uart.write: "OPTO1=ON\n"
- delay: 5s
- uart.write: "OPTO1=OFF\n"
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
#api:
web_server:
port: 80
auth:
username: nils
password: inginf95
uart:
tx_pin: GPIO01
rx_pin: GPIO03
baud_rate: 9600
id: uart_bus
ota:
password: "0848c056d780accd7fbb0dbaf989156b"
wifi:
ssid: "EasyBox-368239"
password: "inginf95"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Sonoff-Basic-Test"
password: "Wky9j6BNCgI0"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff Basic Button"
on_press:
- switch.toggle: fakebutton
switch:
- platform: template
name: "Sonoff Basic Relay"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
- platform: gpio
id: relay
pin: GPIO12
output:
- platform: esp8266_pwm
id: basic_green_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff Basic Green LED"
output: basic_green_led
id: led
sensor:
- platform: wifi_signal
name: "Sonoff Basic WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Sonoff Basic Uptime"
text_sensor:
- platform: version
name: "Sonoff Basic ESPHome Version"
- platform: mqtt_subscribe
name: "UART Tx"
id: command
topic: sonoff-arduino-bridge/cmnd
- platform: custom
lambda: |-
auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));
App.register_component(my_custom_sensor);
return {my_custom_sensor};
text_sensors:
id: "uart_readline"
name: "UART Rx"