refactor
This commit is contained in:
parent
c62f0319e6
commit
e60b96d6e5
38 changed files with 1348 additions and 0 deletions
11
bathroom-lightswitch.yaml
Normal file
11
bathroom-lightswitch.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: bathroom-switch
|
||||||
|
friendly_name: Bathroom Switch
|
||||||
|
touchpad2_action: sonoff_t3_toggle_relay_1_and_3
|
||||||
|
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.10
|
62
bedroom-atom-echo.yaml
Normal file
62
bedroom-atom-echo.yaml
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: bedroom-atom-echo
|
||||||
|
friendly_name: Bedroom Speaker
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include common/base.yaml
|
||||||
|
sensors: !include common/basicSensors.yaml
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
friendly_name: ${friendly_name}
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.34
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
board: m5stack-atom
|
||||||
|
|
||||||
|
improv_serial:
|
||||||
|
|
||||||
|
i2s_audio:
|
||||||
|
i2s_lrclk_pin: GPIO33
|
||||||
|
i2s_bclk_pin: GPIO19
|
||||||
|
|
||||||
|
speaker:
|
||||||
|
- platform: i2s_audio
|
||||||
|
id: echo_speaker
|
||||||
|
i2s_dout_pin: GPIO22
|
||||||
|
dac_type: external
|
||||||
|
mode: mono
|
||||||
|
|
||||||
|
media_player:
|
||||||
|
- platform: i2s_audio
|
||||||
|
id: echo_media
|
||||||
|
name: None
|
||||||
|
dac_type: external
|
||||||
|
i2s_dout_pin: GPIO22
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO39
|
||||||
|
inverted: true
|
||||||
|
name: Button
|
||||||
|
id: echo_button
|
||||||
|
|
||||||
|
light:
|
||||||
|
- platform: esp32_rmt_led_strip
|
||||||
|
id: led
|
||||||
|
name: light
|
||||||
|
entity_category: config
|
||||||
|
pin: GPIO27
|
||||||
|
default_transition_length: 0s
|
||||||
|
chipset: SK6812
|
||||||
|
num_leds: 1
|
||||||
|
rgb_order: grb
|
||||||
|
rmt_channel: 0
|
||||||
|
effects:
|
||||||
|
- pulse:
|
||||||
|
transition_length: 250ms
|
||||||
|
update_interval: 250ms
|
11
bedroom-bluetooth.yaml
Normal file
11
bedroom-bluetooth.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: bedroom-bluetooth
|
||||||
|
friendly_name: Bedroom Bluetooth
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.27
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/nodemcu.yaml
|
||||||
|
bt: !include common/bluetoothProxy.yaml
|
||||||
|
|
10
bedroom-lamp.yaml
Normal file
10
bedroom-lamp.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: bedroom-lamp
|
||||||
|
friendly_name: Bedroom Lamp
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.12
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
18
bedroom-lightswitch.yaml
Normal file
18
bedroom-lightswitch.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: bedroom-switch
|
||||||
|
friendly_name: Bedroom Switch
|
||||||
|
touchpad1_action: toggle_bedroom_lamp
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.3
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: toggle_bedroom_lamp
|
||||||
|
then:
|
||||||
|
- homeassistant.service:
|
||||||
|
service: homeassistant.toggle
|
||||||
|
data:
|
||||||
|
entity_id: "switch.bedroom_lamp_relay"
|
BIN
build/bedroom-atom-echo/media/alarm.mp3
Normal file
BIN
build/bedroom-atom-echo/media/alarm.mp3
Normal file
Binary file not shown.
19
cloakroom-lightswitch.yaml
Normal file
19
cloakroom-lightswitch.yaml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: cloakroom-switch
|
||||||
|
friendly_name: Cloakroom Switch
|
||||||
|
touchpad1_action: toggle_hall_light
|
||||||
|
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.16
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: toggle_hall_light
|
||||||
|
then:
|
||||||
|
- homeassistant.service:
|
||||||
|
service: homeassistant.toggle
|
||||||
|
data:
|
||||||
|
entity_id: "switch.front_door_switch_relay_2"
|
19
common/base.yaml
Normal file
19
common/base.yaml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
wifi:
|
||||||
|
ssid: !secret WIFI_SSID
|
||||||
|
password: !secret WIFI_PASSWORD
|
||||||
|
fast_connect: true
|
||||||
|
reboot_timeout: 300s
|
||||||
|
ap:
|
||||||
|
ssid: ${friendly_name} Hotspot
|
||||||
|
|
||||||
|
logger:
|
||||||
|
level: DEBUG
|
||||||
|
|
||||||
|
api:
|
||||||
|
reboot_timeout: 15min
|
||||||
|
|
||||||
|
ota:
|
||||||
|
|
||||||
|
time:
|
||||||
|
- platform: homeassistant
|
||||||
|
timezone: Europe/London
|
42
common/basicSensors.yaml
Normal file
42
common/basicSensors.yaml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
binary_sensor:
|
||||||
|
- platform: status
|
||||||
|
name: ${friendly_name} Status
|
||||||
|
id: device_status
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: wifi_signal
|
||||||
|
name: ${friendly_name} WiFi Signal Strength
|
||||||
|
id: device_wifi_signal
|
||||||
|
update_interval: 15s
|
||||||
|
|
||||||
|
- platform: uptime
|
||||||
|
name: ${friendly_name} Uptime
|
||||||
|
id: device_uptime
|
||||||
|
update_interval: 15s
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- platform: version
|
||||||
|
name: ${friendly_name} ESPHome Version
|
||||||
|
id: esphome_version
|
||||||
|
|
||||||
|
- platform: wifi_info
|
||||||
|
ip_address:
|
||||||
|
name: ${friendly_name} IP Address
|
||||||
|
id: ip_address
|
||||||
|
|
||||||
|
ssid:
|
||||||
|
name: ${friendly_name} SSID
|
||||||
|
id: ssid
|
||||||
|
|
||||||
|
bssid:
|
||||||
|
name: ${friendly_name} BSSID
|
||||||
|
id: bssid
|
||||||
|
|
||||||
|
mac_address:
|
||||||
|
name: ${friendly_name} MAC Address
|
||||||
|
id: mac_address
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- platform: restart
|
||||||
|
name: ${friendly_name} Restart
|
||||||
|
id: device_restart
|
12
common/bluetoothProxy.yaml
Normal file
12
common/bluetoothProxy.yaml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
esp32:
|
||||||
|
framework:
|
||||||
|
type: esp-idf
|
||||||
|
|
||||||
|
esp32_ble_tracker:
|
||||||
|
scan_parameters:
|
||||||
|
interval: 1100ms
|
||||||
|
window: 1100ms
|
||||||
|
active: true
|
||||||
|
|
||||||
|
bluetooth_proxy:
|
||||||
|
active: true
|
67
common/lightEffects.yaml
Normal file
67
common/lightEffects.yaml
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
- lambda:
|
||||||
|
name: RGB Breathing
|
||||||
|
update_interval: 16s #Finetune to your liking with the transition lenght below
|
||||||
|
lambda: |-
|
||||||
|
#define Color1 1.0, 0.0, 0.0 //These are the colors defined, feel free to change or extend the list
|
||||||
|
#define Color2 1.0, 0.5, 0.0 //if you extend the list, dont forget to add them in the switch loop below
|
||||||
|
#define Color3 1.0, 1.0, 0.0 //and remember to adjust the reset counter at the bottom
|
||||||
|
#define Color4 0.5, 1.0, 0.0
|
||||||
|
#define Color5 0.0, 1.0, 0.0
|
||||||
|
#define Color6 0.0, 1.0, 0.5
|
||||||
|
#define Color7 0.0, 1.0, 1.0
|
||||||
|
#define Color8 0.0, 0.5, 1.0
|
||||||
|
#define Color9 0.0, 0.0, 1.0
|
||||||
|
#define Color10 0.5, 0.0, 1.0
|
||||||
|
#define Color11 0.5, 0.0, 1.0
|
||||||
|
#define Color12 1.0, 0.0, 0.5
|
||||||
|
static int state = 0;
|
||||||
|
static int color = 1;
|
||||||
|
auto call = id(light1).turn_on();
|
||||||
|
call.set_transition_length(15000);
|
||||||
|
if (state == 0)
|
||||||
|
{
|
||||||
|
call.set_brightness(0.01);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (state == 1)
|
||||||
|
{
|
||||||
|
switch(color)
|
||||||
|
{
|
||||||
|
case 1: call.set_rgb(Color1);
|
||||||
|
break;
|
||||||
|
case 2: call.set_rgb(Color2);
|
||||||
|
break;
|
||||||
|
case 3: call.set_rgb(Color3);
|
||||||
|
break;
|
||||||
|
case 4: call.set_rgb(Color4);
|
||||||
|
break;
|
||||||
|
case 5: call.set_rgb(Color5);
|
||||||
|
break;
|
||||||
|
case 6: call.set_rgb(Color6);
|
||||||
|
break;
|
||||||
|
case 7: call.set_rgb(Color7);
|
||||||
|
break;
|
||||||
|
case 8: call.set_rgb(Color8);
|
||||||
|
break;
|
||||||
|
case 9: call.set_rgb(Color9);
|
||||||
|
break;
|
||||||
|
case 10: call.set_rgb(Color10);
|
||||||
|
break;
|
||||||
|
case 11: call.set_rgb(Color11);
|
||||||
|
break;
|
||||||
|
case 12: call.set_rgb(Color12);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
call.set_brightness(1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
state ++;
|
||||||
|
if (state == 2){
|
||||||
|
state = 0;
|
||||||
|
}
|
||||||
|
color++;
|
||||||
|
if(color == 7)
|
||||||
|
{
|
||||||
|
color = 1;
|
||||||
|
}
|
||||||
|
call.perform();
|
59
devices/athom-bulb.yaml
Normal file
59
devices/athom-bulb.yaml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
substitutions:
|
||||||
|
light_restore_mode: RESTORE_DEFAULT_ON
|
||||||
|
color_interlock: 'true'
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
board: esp8285
|
||||||
|
platform: ESP8266
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
#on_boot:
|
||||||
|
# then:
|
||||||
|
# - script.execute: fast_boot_script
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include ../common/base.yaml
|
||||||
|
basicSensors: !include ../common/basicSensors.yaml
|
||||||
|
|
||||||
|
output:
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: red_output
|
||||||
|
pin: GPIO4
|
||||||
|
min_power: 0.000499
|
||||||
|
max_power: 1
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: green_output
|
||||||
|
pin: GPIO12
|
||||||
|
min_power: 0.000499
|
||||||
|
max_power: 1
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: blue_output
|
||||||
|
pin: GPIO14
|
||||||
|
min_power: 0.000499
|
||||||
|
max_power: 1
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: warm_white_output
|
||||||
|
pin: GPIO13
|
||||||
|
min_power: 0.000499
|
||||||
|
max_power: 1
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: white_output
|
||||||
|
pin: GPIO5
|
||||||
|
min_power: 0.000499
|
||||||
|
max_power: 1
|
||||||
|
|
||||||
|
|
||||||
|
light:
|
||||||
|
- platform: rgbww
|
||||||
|
id: light1
|
||||||
|
name: "${friendly_name} Bulb"
|
||||||
|
restore_mode: ${light_restore_mode}
|
||||||
|
red: red_output
|
||||||
|
green: green_output
|
||||||
|
blue: blue_output
|
||||||
|
warm_white: warm_white_output
|
||||||
|
cold_white: white_output
|
||||||
|
cold_white_color_temperature: 6000 K
|
||||||
|
warm_white_color_temperature: 3000 K
|
||||||
|
color_interlock: ${color_interlock}
|
||||||
|
effects: !include ../common/lightEffects.yaml
|
310
devices/localbytes-plug.yaml
Normal file
310
devices/localbytes-plug.yaml
Normal file
|
@ -0,0 +1,310 @@
|
||||||
|
# Largely based off this:
|
||||||
|
#https://github.com/JamesSwift/localbytes-plug-pm/blob/main/localbytes-plug-pm.yaml
|
||||||
|
substitutions:
|
||||||
|
# Icon
|
||||||
|
main_icon: "power-socket-uk"
|
||||||
|
default_state: "RESTORE_DEFAULT_OFF"
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
friendly_name: ${friendly_name}
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
output_power: 18db
|
||||||
|
power_save_mode: light
|
||||||
|
|
||||||
|
esp8266:
|
||||||
|
board: esp01_1m
|
||||||
|
restore_from_flash: true
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include ../common/base.yaml
|
||||||
|
basicSensors: !include ../common/basicSensors.yaml
|
||||||
|
|
||||||
|
globals:
|
||||||
|
- id: voltage_multiply
|
||||||
|
type: float
|
||||||
|
restore_value: true
|
||||||
|
initial_value: "0.3"
|
||||||
|
|
||||||
|
- id: power_multiply
|
||||||
|
type: float
|
||||||
|
restore_value: true
|
||||||
|
initial_value: "0.133"
|
||||||
|
|
||||||
|
- id: current_multiply
|
||||||
|
type: float
|
||||||
|
restore_value: true
|
||||||
|
initial_value: "0.805"
|
||||||
|
|
||||||
|
api:
|
||||||
|
services:
|
||||||
|
- service: calibrate_voltage
|
||||||
|
variables:
|
||||||
|
actual_value: float
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(voltage_multiply) = actual_value / id(voltage).raw_state;
|
||||||
|
- number.set:
|
||||||
|
id: voltage_factor
|
||||||
|
value: !lambda "return id(voltage_multiply);"
|
||||||
|
|
||||||
|
- service: calibrate_power
|
||||||
|
variables:
|
||||||
|
actual_value: float
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(power_multiply) = actual_value / id(power).raw_state;
|
||||||
|
- number.set:
|
||||||
|
id: power_factor
|
||||||
|
value: !lambda "return id(power_multiply);"
|
||||||
|
|
||||||
|
- service: calibrate_current
|
||||||
|
variables:
|
||||||
|
actual_value: float
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(current_multiply) = actual_value / id(current).raw_state;
|
||||||
|
- number.set:
|
||||||
|
id: current_factor
|
||||||
|
value: !lambda "return id(current_multiply);"
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
# Power Monitoring
|
||||||
|
- platform: hlw8012
|
||||||
|
sel_pin:
|
||||||
|
number: GPIO12
|
||||||
|
inverted: true
|
||||||
|
cf_pin: GPIO4
|
||||||
|
cf1_pin: GPIO5
|
||||||
|
change_mode_every: 3
|
||||||
|
update_interval: 6s
|
||||||
|
|
||||||
|
voltage:
|
||||||
|
name: "Voltage"
|
||||||
|
id: voltage
|
||||||
|
unit_of_measurement: V
|
||||||
|
accuracy_decimals: 1
|
||||||
|
filters:
|
||||||
|
- lambda: return x * id(voltage_multiply);
|
||||||
|
|
||||||
|
power:
|
||||||
|
name: "Power"
|
||||||
|
id: power
|
||||||
|
unit_of_measurement: W
|
||||||
|
accuracy_decimals: 0
|
||||||
|
filters:
|
||||||
|
- lambda: return x * id(power_multiply);
|
||||||
|
|
||||||
|
current:
|
||||||
|
name: "Current"
|
||||||
|
id: current
|
||||||
|
unit_of_measurement: A
|
||||||
|
accuracy_decimals: 3
|
||||||
|
filters:
|
||||||
|
- lambda: return x * id(current_multiply);
|
||||||
|
|
||||||
|
# Total daily energy sensor
|
||||||
|
- platform: total_daily_energy
|
||||||
|
name: "Daily Energy"
|
||||||
|
power_id: power
|
||||||
|
filters:
|
||||||
|
# Multiplication factor from W to kW is 0.001
|
||||||
|
- multiply: 0.001
|
||||||
|
unit_of_measurement: kWh
|
||||||
|
|
||||||
|
|
||||||
|
# Make calibration factor data readable/setable from home assistant
|
||||||
|
number:
|
||||||
|
- platform: template
|
||||||
|
name: "Voltage Calibration Factor"
|
||||||
|
id: voltage_factor
|
||||||
|
icon: "mdi:sine-wave"
|
||||||
|
min_value: 0
|
||||||
|
max_value: 10
|
||||||
|
step: 0.001
|
||||||
|
entity_category: diagnostic
|
||||||
|
mode: box
|
||||||
|
lambda: |-
|
||||||
|
return id(voltage_multiply);
|
||||||
|
set_action:
|
||||||
|
lambda: |-
|
||||||
|
id(voltage_multiply) = x;
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
name: "Power Calibration Factor"
|
||||||
|
id: power_factor
|
||||||
|
icon: "mdi:flash"
|
||||||
|
min_value: 0
|
||||||
|
max_value: 10
|
||||||
|
step: 0.001
|
||||||
|
entity_category: diagnostic
|
||||||
|
mode: box
|
||||||
|
lambda: |-
|
||||||
|
return id(power_multiply);
|
||||||
|
set_action:
|
||||||
|
lambda: |-
|
||||||
|
id(power_multiply) = x;
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
name: "Current Calibration Factor"
|
||||||
|
id: current_factor
|
||||||
|
icon: "mdi:current-ac"
|
||||||
|
min_value: 0
|
||||||
|
max_value: 10
|
||||||
|
step: 0.001
|
||||||
|
entity_category: diagnostic
|
||||||
|
mode: box
|
||||||
|
lambda: |-
|
||||||
|
return id(current_multiply);
|
||||||
|
set_action:
|
||||||
|
lambda: |-
|
||||||
|
id(current_multiply) = x;
|
||||||
|
|
||||||
|
# Relay State LED
|
||||||
|
output:
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: state_led
|
||||||
|
pin:
|
||||||
|
number: GPIO13
|
||||||
|
inverted: true
|
||||||
|
|
||||||
|
light:
|
||||||
|
- platform: binary
|
||||||
|
output: state_led
|
||||||
|
id: led
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
# Push Button (Toggles Relay When Pressed)
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO3
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
inverted: true
|
||||||
|
name: "Button"
|
||||||
|
on_click:
|
||||||
|
|
||||||
|
- max_length: 1s
|
||||||
|
then:
|
||||||
|
if:
|
||||||
|
condition:
|
||||||
|
switch.is_off: disable_button
|
||||||
|
then:
|
||||||
|
switch.toggle: relay
|
||||||
|
|
||||||
|
- min_length: 1.5s
|
||||||
|
max_length: 5s
|
||||||
|
then:
|
||||||
|
switch.toggle: disable_led
|
||||||
|
|
||||||
|
- min_length: 8s
|
||||||
|
max_length: 12s
|
||||||
|
then:
|
||||||
|
switch.toggle: disable_button
|
||||||
|
|
||||||
|
|
||||||
|
switch:
|
||||||
|
# Relay (As Switch)
|
||||||
|
- platform: gpio
|
||||||
|
name: ""
|
||||||
|
icon: "mdi:${main_icon}"
|
||||||
|
pin: GPIO14
|
||||||
|
id: relay
|
||||||
|
restore_mode: "${default_state}"
|
||||||
|
on_turn_on:
|
||||||
|
if:
|
||||||
|
condition:
|
||||||
|
switch.is_off: disable_led
|
||||||
|
then:
|
||||||
|
light.turn_on:
|
||||||
|
id: led
|
||||||
|
on_turn_off:
|
||||||
|
- light.turn_off:
|
||||||
|
id: led
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
name: "Disable LED"
|
||||||
|
id: disable_led
|
||||||
|
icon: "mdi:led-variant-off"
|
||||||
|
restore_mode: "${default_state}"
|
||||||
|
optimistic: true
|
||||||
|
on_turn_on:
|
||||||
|
#Flash twice
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.1s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.1s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.1s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.1s
|
||||||
|
#Final state
|
||||||
|
- light.turn_off: led
|
||||||
|
on_turn_off:
|
||||||
|
#Flash twice
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.1s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.1s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.1s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.7s
|
||||||
|
#Final state
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
switch.is_on: relay
|
||||||
|
then:
|
||||||
|
light.turn_on: led
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
name: "Disable Button"
|
||||||
|
id: disable_button
|
||||||
|
icon: "mdi:toggle-switch-off-outline"
|
||||||
|
restore_mode: "${default_state}"
|
||||||
|
optimistic: true
|
||||||
|
on_turn_on:
|
||||||
|
#Flash thrice
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.15s
|
||||||
|
#Final state
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
switch.is_off: relay
|
||||||
|
then:
|
||||||
|
light.turn_off: led
|
||||||
|
on_turn_off:
|
||||||
|
#Flash thrice
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_on: led
|
||||||
|
- delay: 0.15s
|
||||||
|
- light.turn_off: led
|
||||||
|
- delay: 0.7s
|
||||||
|
#Final state
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
switch.is_on: relay
|
||||||
|
then:
|
||||||
|
light.turn_on: led
|
||||||
|
|
||||||
|
|
13
devices/nodemcu.yaml
Normal file
13
devices/nodemcu.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
substitutions:
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
friendly_name: ${friendly_name}
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
board: nodemcu-32s
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include ../common/base.yaml
|
||||||
|
basicSensors: !include ../common/basicSensors.yaml
|
47
devices/sonoff-basic.yaml
Normal file
47
devices/sonoff-basic.yaml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
substitutions:
|
||||||
|
button_action: sonoff_button_toggle_relay
|
||||||
|
relay_on_action: nullScript
|
||||||
|
relay_off_action: nullScript
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
board: esp8285
|
||||||
|
platform: ESP8266
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include ../common/base.yaml
|
||||||
|
basicSensors: !include ../common/basicSensors.yaml
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- platform: gpio
|
||||||
|
name: "${friendly_name} Relay"
|
||||||
|
id: relay
|
||||||
|
pin: GPIO12
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
on_turn_on:
|
||||||
|
then:
|
||||||
|
- script.execute: "${relay_on_action}"
|
||||||
|
on_turn_off:
|
||||||
|
then:
|
||||||
|
- script.execute: "${relay_off_action}"
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO0
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
inverted: True
|
||||||
|
name: "${friendly_name} Button"
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- script.execute: "${button_action}"
|
||||||
|
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: sonoff_button_toggle_relay
|
||||||
|
then:
|
||||||
|
- switch.toggle: relay
|
||||||
|
- id: nullScript
|
||||||
|
then:
|
||||||
|
|
95
devices/sonoff-t3.yaml
Normal file
95
devices/sonoff-t3.yaml
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
substitutions:
|
||||||
|
touchpad1_action: sonoff_t3_toggle_relay_1
|
||||||
|
touchpad2_action: sonoff_t3_toggle_relay_2
|
||||||
|
touchpad3_action: sonoff_t3_toggle_relay_3
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
board: esp01_1m
|
||||||
|
platform: ESP8266
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include ../common/base.yaml
|
||||||
|
basicSensors: !include ../common/basicSensors.yaml
|
||||||
|
|
||||||
|
output:
|
||||||
|
- platform: esp8266_pwm
|
||||||
|
id: blue_led
|
||||||
|
pin: GPIO13
|
||||||
|
inverted: True
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- platform: gpio
|
||||||
|
name: "${friendly_name} Relay 1"
|
||||||
|
id: relay_1
|
||||||
|
pin: GPIO12
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
- platform: gpio
|
||||||
|
name: "${friendly_name} Relay 2"
|
||||||
|
id: relay_2
|
||||||
|
pin: GPIO5
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
- platform: gpio
|
||||||
|
name: "${friendly_name} Relay 3"
|
||||||
|
id: relay_3
|
||||||
|
pin: GPIO4
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO0
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
inverted: True
|
||||||
|
name: "${friendly_name} Touchpad 1"
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- output.turn_on: blue_led
|
||||||
|
- script.execute: "${touchpad1_action}"
|
||||||
|
on_release:
|
||||||
|
then:
|
||||||
|
- output.turn_off: blue_led
|
||||||
|
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO9
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
inverted: True
|
||||||
|
name: "${friendly_name} Touchpad 2"
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- output.turn_on: blue_led
|
||||||
|
- script.execute: "${touchpad2_action}"
|
||||||
|
on_release:
|
||||||
|
then:
|
||||||
|
- output.turn_off: blue_led
|
||||||
|
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO10
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
inverted: True
|
||||||
|
name: "${friendly_name} Touchpad 3"
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- output.turn_on: blue_led
|
||||||
|
- script.execute: "${touchpad3_action}"
|
||||||
|
on_release:
|
||||||
|
then:
|
||||||
|
- output.turn_off: blue_led
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: sonoff_t3_toggle_relay_1
|
||||||
|
then:
|
||||||
|
- switch.toggle: relay_1
|
||||||
|
- id: sonoff_t3_toggle_relay_2
|
||||||
|
then:
|
||||||
|
- switch.toggle: relay_2
|
||||||
|
- id: sonoff_t3_toggle_relay_3
|
||||||
|
then:
|
||||||
|
- switch.toggle: relay_3
|
||||||
|
- id: sonoff_t3_toggle_relay_1_and_3
|
||||||
|
then:
|
||||||
|
- switch.toggle: relay_1
|
||||||
|
- switch.toggle: relay_3
|
11
ensuite-lightswitch.yaml
Normal file
11
ensuite-lightswitch.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: ensuite-switch
|
||||||
|
friendly_name: En-Suite Switch
|
||||||
|
touchpad2_action: sonoff_t3_toggle_relay_1_and_3
|
||||||
|
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.5
|
10
green-wax-melt.yaml
Normal file
10
green-wax-melt.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: green-wax-melt
|
||||||
|
friendly_name: Green Wax Melt
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.29
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
10
grey-wax-melt.yaml
Normal file
10
grey-wax-melt.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: grey-wax-melt
|
||||||
|
friendly_name: Grey Wax Melt
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.32
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
18
hall-by-front-door.yaml
Normal file
18
hall-by-front-door.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: hall-by-front-door
|
||||||
|
friendly_name: Front Door Switch
|
||||||
|
touchpad1_action: toggle_landing_light
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.6
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: toggle_landing_light
|
||||||
|
then:
|
||||||
|
- homeassistant.service:
|
||||||
|
service: homeassistant.toggle
|
||||||
|
data:
|
||||||
|
entity_id: "switch.landing_switch_relay_2"
|
10
heated-blanket.yaml
Normal file
10
heated-blanket.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: heated-blanket-switch
|
||||||
|
friendly_name: Heated Blanket Switch
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.31
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/localbytes-plug.yaml
|
||||||
|
|
32
heating-downstairs.yaml
Normal file
32
heating-downstairs.yaml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: heating-downstairs
|
||||||
|
friendly_name: Heating Downstairs
|
||||||
|
relay_on_action: turn_on
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.18
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
||||||
|
# Give the user a graphical control over the timeout
|
||||||
|
# See: https://esphome.io/components/number/template.html
|
||||||
|
number:
|
||||||
|
- name: "${friendly_name} Timeout"
|
||||||
|
id: timeout_length
|
||||||
|
platform: template
|
||||||
|
# TODO: maybe it's a better UX to do this in hours and minutes and do the conversion in esphome
|
||||||
|
unit_of_measurement: minutes
|
||||||
|
min_value: 10
|
||||||
|
# Never want it on for more than 3 hours
|
||||||
|
# 3*60 = 180
|
||||||
|
max_value: 180
|
||||||
|
initial_value: 60
|
||||||
|
step: 10
|
||||||
|
optimistic: true
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: turn_on
|
||||||
|
then:
|
||||||
|
- delay: !lambda 'return id(timeout_length).state * 60 * 1000;'
|
||||||
|
- lambda: !lambda id(relay).turn_off();
|
77
heating-upstairs.bac
Normal file
77
heating-upstairs.bac
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: heating-upstairs
|
||||||
|
friendly_name: Heating Upstairs
|
||||||
|
relay_on_action: turn_on_action
|
||||||
|
relay_off_action: turn_off_action
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.17
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
||||||
|
globals:
|
||||||
|
- id: total_minutes
|
||||||
|
type: int
|
||||||
|
initial_value: "0"
|
||||||
|
- id: minutes_passed
|
||||||
|
type: int
|
||||||
|
initial_value: "0"
|
||||||
|
|
||||||
|
# Give the user a graphical control over the timeout
|
||||||
|
# See: https://esphome.io/components/number/template.html
|
||||||
|
number:
|
||||||
|
- name: "${friendly_name} Timeout"
|
||||||
|
id: timeout_length
|
||||||
|
platform: template
|
||||||
|
# TODO: maybe it's a better UX to do this in hours and minutes and do the conversion in esphome
|
||||||
|
unit_of_measurement: minutes
|
||||||
|
# Min 5 minutes
|
||||||
|
min_value: 10
|
||||||
|
# Never want it on for more than 3 hours
|
||||||
|
# 3*60 = 180
|
||||||
|
max_value: 180
|
||||||
|
initial_value: 10
|
||||||
|
step: 10
|
||||||
|
optimistic: true
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- name: "${friendly_name} Total Time"
|
||||||
|
platform: template
|
||||||
|
lambda: !lambda 'return id(total_minutes);'
|
||||||
|
unit_of_measurement: 'minutes'
|
||||||
|
accuracy_decimals: 0
|
||||||
|
- name: "${friendly_name} Elapsed Time"
|
||||||
|
platform: template
|
||||||
|
lambda: !lambda 'return id(minutes_passed);'
|
||||||
|
unit_of_measurement: 'minutes'
|
||||||
|
accuracy_decimals: 0
|
||||||
|
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: turn_on_action
|
||||||
|
then:
|
||||||
|
- logger.log: "Turn On"
|
||||||
|
- lambda: |-
|
||||||
|
id(total_minutes) = id(timeout_length).state;
|
||||||
|
id(minutes_passed) = 0;
|
||||||
|
id(tick).execute();
|
||||||
|
- id: turn_off_action
|
||||||
|
then:
|
||||||
|
- logger.log: "Turn Off"
|
||||||
|
- lambda: |-
|
||||||
|
id(relay).turn_off();
|
||||||
|
id(minutes_passed) = 0;
|
||||||
|
id(total_minutes) = 0;
|
||||||
|
- id: tick
|
||||||
|
mode: queued
|
||||||
|
then:
|
||||||
|
- delay: 1min
|
||||||
|
- logger.log: "Tick"
|
||||||
|
- lambda: |-
|
||||||
|
id(minutes_passed) += 1;
|
||||||
|
if (id(minutes_passed) >= id(total_minutes) ) {
|
||||||
|
id(turn_off_action).execute();
|
||||||
|
} else {
|
||||||
|
id(tick).execute();
|
||||||
|
}
|
33
heating-upstairs.yaml
Normal file
33
heating-upstairs.yaml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: heating-upstairs
|
||||||
|
friendly_name: Heating Upstairs
|
||||||
|
relay_on_action: turn_on
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.17
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
||||||
|
|
||||||
|
# Give the user a graphical control over the timeout
|
||||||
|
# See: https://esphome.io/components/number/template.html
|
||||||
|
number:
|
||||||
|
- name: "${friendly_name} Timeout"
|
||||||
|
id: timeout_length
|
||||||
|
platform: template
|
||||||
|
# TODO: maybe it's a better UX to do this in hours and minutes and do the conversion in esphome
|
||||||
|
unit_of_measurement: minutes
|
||||||
|
min_value: 10
|
||||||
|
# Never want it on for more than 3 hours
|
||||||
|
# 3*60 = 180
|
||||||
|
max_value: 180
|
||||||
|
initial_value: 60
|
||||||
|
step: 10
|
||||||
|
optimistic: true
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: turn_on
|
||||||
|
then:
|
||||||
|
- delay: !lambda 'return id(timeout_length).state * 60 * 1000;'
|
||||||
|
- lambda: !lambda id(relay).turn_off();
|
13
kitchen.yaml
Normal file
13
kitchen.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: kitchen-switch
|
||||||
|
friendly_name: Kitchen
|
||||||
|
#touchpad1_action: sonoff_t3_toggle_relay_2
|
||||||
|
touchpad2_action: sonoff_t3_toggle_relay_1_and_3
|
||||||
|
#touchpad3_action: sonoff_t3_toggle_relay_2
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.9
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
13
landing-lightswitch.yaml
Normal file
13
landing-lightswitch.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: landing-switch
|
||||||
|
friendly_name: Landing Switch
|
||||||
|
touchpad1_action: sonoff_t3_toggle_relay_2
|
||||||
|
touchpad2_action: sonoff_t3_toggle_relay_2
|
||||||
|
touchpad3_action: sonoff_t3_toggle_relay_2
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.4
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
13
lounge-by-garden.yaml
Normal file
13
lounge-by-garden.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: lounge-by-garden
|
||||||
|
friendly_name: Lounge 2
|
||||||
|
#touchpad1_action: sonoff_t3_toggle_relay_2
|
||||||
|
#touchpad2_action: sonoff_t3_toggle_relay_2
|
||||||
|
#touchpad3_action: sonoff_t3_toggle_relay_2
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.8
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
32
lounge-by-hall.yaml
Normal file
32
lounge-by-hall.yaml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: lounge-by-hall
|
||||||
|
friendly_name: Lounge 1
|
||||||
|
touchpad1_action: toggle_lounge_light
|
||||||
|
touchpad2_action: toggle_lamp
|
||||||
|
touchpad3_action: toggle_dining_light
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.7
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: toggle_lounge_light
|
||||||
|
then:
|
||||||
|
- homeassistant.service:
|
||||||
|
service: homeassistant.toggle
|
||||||
|
data:
|
||||||
|
entity_id: "light.lounge_light_1_bulb"
|
||||||
|
- id: toggle_dining_light
|
||||||
|
then:
|
||||||
|
- homeassistant.service:
|
||||||
|
service: homeassistant.toggle
|
||||||
|
data:
|
||||||
|
entity_id: "light.lounge_light_2_bulb"
|
||||||
|
- id: toggle_lamp
|
||||||
|
then:
|
||||||
|
- homeassistant.service:
|
||||||
|
service: homeassistant.toggle
|
||||||
|
data:
|
||||||
|
entity_id: "light.lounge_lamp_relay"
|
10
lounge-lamp.yaml
Normal file
10
lounge-lamp.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: lounge-lamp
|
||||||
|
friendly_name: Lounge Lamp
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.13
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
10
lounge-light-1.yaml
Normal file
10
lounge-light-1.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: lounge-light-1
|
||||||
|
friendly_name: Lounge Light 1
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.19
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/athom-bulb.yaml
|
||||||
|
|
10
lounge-light-2.yaml
Normal file
10
lounge-light-2.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: lounge-light-2
|
||||||
|
friendly_name: Lounge Light 2
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.24
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/athom-bulb.yaml
|
||||||
|
|
10
man-cave-desk.yaml
Normal file
10
man-cave-desk.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: man-cave-switch
|
||||||
|
friendly_name: Man Cave Desk Switch
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.26
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/localbytes-plug.yaml
|
||||||
|
|
10
man-cave-lightswitch.yaml
Normal file
10
man-cave-lightswitch.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: man-cave-switch
|
||||||
|
friendly_name: Man Cave Switch
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.15
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
201
office-atom-echo.yaml
Normal file
201
office-atom-echo.yaml
Normal file
|
@ -0,0 +1,201 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: office-atom-echo
|
||||||
|
friendly_name: Office Speaker
|
||||||
|
|
||||||
|
packages:
|
||||||
|
base: !include common/base.yaml
|
||||||
|
sensors: !include common/basicSensors.yaml
|
||||||
|
|
||||||
|
esphome:
|
||||||
|
name: ${hostname}
|
||||||
|
build_path: ./build/${hostname}
|
||||||
|
friendly_name: ${friendly_name}
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.28
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
board: m5stack-atom
|
||||||
|
|
||||||
|
improv_serial:
|
||||||
|
|
||||||
|
i2s_audio:
|
||||||
|
i2s_lrclk_pin: GPIO33
|
||||||
|
i2s_bclk_pin: GPIO19
|
||||||
|
|
||||||
|
#microphone:
|
||||||
|
# - platform: i2s_audio
|
||||||
|
# id: echo_microphone
|
||||||
|
# i2s_din_pin: GPIO23
|
||||||
|
# adc_type: external
|
||||||
|
# pdm: true
|
||||||
|
|
||||||
|
speaker:
|
||||||
|
- platform: i2s_audio
|
||||||
|
id: echo_speaker
|
||||||
|
i2s_dout_pin: GPIO22
|
||||||
|
dac_type: external
|
||||||
|
mode: mono
|
||||||
|
|
||||||
|
media_player:
|
||||||
|
- platform: i2s_audio
|
||||||
|
id: echo_media
|
||||||
|
name: None
|
||||||
|
dac_type: external
|
||||||
|
i2s_dout_pin: GPIO22
|
||||||
|
|
||||||
|
|
||||||
|
#voice_assistant:
|
||||||
|
# id: va
|
||||||
|
# microphone: echo_microphone
|
||||||
|
# speaker: echo_speaker
|
||||||
|
# noise_suppression_level: 2
|
||||||
|
# auto_gain: 31dBFS
|
||||||
|
# volume_multiplier: 2.0
|
||||||
|
# vad_threshold: 3
|
||||||
|
# on_listening:
|
||||||
|
# - light.turn_on:
|
||||||
|
# id: led
|
||||||
|
# blue: 100%
|
||||||
|
# red: 0%
|
||||||
|
# green: 0%
|
||||||
|
# brightness: 100%
|
||||||
|
# effect: pulse
|
||||||
|
# on_tts_start:
|
||||||
|
# - light.turn_on:
|
||||||
|
# id: led
|
||||||
|
# blue: 0%
|
||||||
|
# red: 0%
|
||||||
|
# green: 100%
|
||||||
|
# brightness: 100%
|
||||||
|
# effect: pulse
|
||||||
|
# on_end:
|
||||||
|
# - delay: 100ms
|
||||||
|
# - wait_until:
|
||||||
|
# not:
|
||||||
|
# speaker.is_playing:
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# on_error:
|
||||||
|
# - light.turn_on:
|
||||||
|
# id: led
|
||||||
|
# blue: 0%
|
||||||
|
# red: 100%
|
||||||
|
# green: 0%
|
||||||
|
# brightness: 100%
|
||||||
|
# effect: none
|
||||||
|
# - delay: 1s
|
||||||
|
# - script.execute: reset_led
|
||||||
|
#
|
||||||
|
# on_client_connected:
|
||||||
|
# - if:
|
||||||
|
# condition:
|
||||||
|
# switch.is_on: use_wake_word
|
||||||
|
# then:
|
||||||
|
# - voice_assistant.start_continuous:
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# on_client_disconnected:
|
||||||
|
# - if:
|
||||||
|
# condition:
|
||||||
|
# switch.is_on: use_wake_word
|
||||||
|
# then:
|
||||||
|
# - voice_assistant.stop:
|
||||||
|
# - light.turn_off: led
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO39
|
||||||
|
inverted: true
|
||||||
|
name: Button
|
||||||
|
id: echo_button
|
||||||
|
#on_click:
|
||||||
|
# - if:
|
||||||
|
# condition:
|
||||||
|
# switch.is_off: use_wake_word
|
||||||
|
# then:
|
||||||
|
# - if:
|
||||||
|
# condition: voice_assistant.is_running
|
||||||
|
# then:
|
||||||
|
# - voice_assistant.stop:
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# else:
|
||||||
|
# - voice_assistant.start:
|
||||||
|
# else:
|
||||||
|
# - voice_assistant.stop
|
||||||
|
# - delay: 1s
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# - script.wait: reset_led
|
||||||
|
# - voice_assistant.start_continuous:
|
||||||
|
|
||||||
|
light:
|
||||||
|
- platform: esp32_rmt_led_strip
|
||||||
|
id: led
|
||||||
|
name: light
|
||||||
|
entity_category: config
|
||||||
|
pin: GPIO27
|
||||||
|
default_transition_length: 0s
|
||||||
|
chipset: SK6812
|
||||||
|
num_leds: 1
|
||||||
|
rgb_order: grb
|
||||||
|
rmt_channel: 0
|
||||||
|
effects:
|
||||||
|
- pulse:
|
||||||
|
transition_length: 250ms
|
||||||
|
update_interval: 250ms
|
||||||
|
|
||||||
|
#script:
|
||||||
|
# - id: reset_led
|
||||||
|
# then:
|
||||||
|
# - if:
|
||||||
|
# condition:
|
||||||
|
# - switch.is_on: use_wake_word
|
||||||
|
# - switch.is_on: use_listen_light
|
||||||
|
# then:
|
||||||
|
# - light.turn_on:
|
||||||
|
# id: led
|
||||||
|
# blue: 100%
|
||||||
|
# red: 100%
|
||||||
|
# green: 0%
|
||||||
|
# brightness: 100%
|
||||||
|
# effect: none
|
||||||
|
# else:
|
||||||
|
# - light.turn_off: led
|
||||||
|
|
||||||
|
#switch:
|
||||||
|
# - platform: template
|
||||||
|
# name: Use wake word
|
||||||
|
# id: use_wake_word
|
||||||
|
# optimistic: true
|
||||||
|
# restore_mode: RESTORE_DEFAULT_ON
|
||||||
|
# entity_category: config
|
||||||
|
# on_turn_on:
|
||||||
|
# - lambda: id(va).set_use_wake_word(true);
|
||||||
|
# - if:
|
||||||
|
# condition:
|
||||||
|
# not:
|
||||||
|
# - voice_assistant.is_running
|
||||||
|
# then:
|
||||||
|
# - voice_assistant.start_continuous
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# on_turn_off:
|
||||||
|
# - voice_assistant.stop
|
||||||
|
# - lambda: id(va).set_use_wake_word(false);
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# - platform: template
|
||||||
|
# name: Use Listen Light
|
||||||
|
# id: use_listen_light
|
||||||
|
# optimistic: true
|
||||||
|
# restore_mode: RESTORE_DEFAULT_ON
|
||||||
|
# entity_category: config
|
||||||
|
# on_turn_on:
|
||||||
|
# - script.execute: reset_led
|
||||||
|
# on_turn_off:
|
||||||
|
# - script.execute: reset_led
|
||||||
|
#
|
||||||
|
#external_components:
|
||||||
|
# - source: github://pr#5230
|
||||||
|
# components:
|
||||||
|
# - esp_adf
|
||||||
|
# refresh: 0s
|
||||||
|
|
||||||
|
#esp_adf:
|
BIN
secrets.yaml
BIN
secrets.yaml
Binary file not shown.
10
spare-room-lamp.yaml
Normal file
10
spare-room-lamp.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: spare-room-lamp
|
||||||
|
friendly_name: Spare Room Lamp
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.21
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-basic.yaml
|
||||||
|
|
10
spare-room-lightswitch.yaml
Normal file
10
spare-room-lightswitch.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: spare-room-switch
|
||||||
|
friendly_name: Spare Room Switch
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.14
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/sonoff-t3.yaml
|
||||||
|
|
10
tv-switch.yaml
Normal file
10
tv-switch.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
substitutions:
|
||||||
|
hostname: tv-switch
|
||||||
|
friendly_name: TV Switch
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
use_address: 192.168.10.20
|
||||||
|
|
||||||
|
packages:
|
||||||
|
device: !include devices/localbytes-plug.yaml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue