Compare commits
2 commits
b26d01d387
...
213469defa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
213469defa | ||
![]() |
f20540792f |
3 changed files with 162 additions and 47 deletions
31
common/base.yaml
Normal file
31
common/base.yaml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
time:
|
||||||
|
- platform: sntp
|
||||||
|
id: time_sntp
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: status
|
||||||
|
name: Status
|
||||||
|
id: ink_ha_connected
|
||||||
|
entity_category: diagnostic
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: uptime
|
||||||
|
name: Uptime
|
||||||
|
type: timestamp
|
||||||
|
time_id: time_sntp
|
||||||
|
entity_category: diagnostic
|
||||||
|
- platform: wifi_signal
|
||||||
|
name: RSSI
|
||||||
|
update_interval: 60s
|
||||||
|
entity_category: diagnostic
|
||||||
|
|
||||||
|
button:
|
||||||
|
- platform: restart
|
||||||
|
icon: mdi:power-cycle
|
||||||
|
name: ESP Reboot
|
||||||
|
entity_category: diagnostic
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- platform: wifi_info
|
||||||
|
ip_address:
|
||||||
|
name: IP Address
|
114
doorbell.yaml
114
doorbell.yaml
|
@ -5,10 +5,14 @@ esphome:
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: esp32dev
|
board: esp32dev
|
||||||
|
framework:
|
||||||
|
type: esp-idf
|
||||||
|
|
||||||
|
packages: !include common/base.yaml
|
||||||
|
|
||||||
# Enable Home Assistant API
|
# Enable Home Assistant API
|
||||||
api:
|
api:
|
||||||
web_server:
|
logger:
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
- platform: esphome
|
- platform: esphome
|
||||||
|
@ -18,15 +22,35 @@ wifi:
|
||||||
ssid: !secret wifi_ssid
|
ssid: !secret wifi_ssid
|
||||||
password: !secret wifi_password
|
password: !secret wifi_password
|
||||||
|
|
||||||
sensor:
|
event:
|
||||||
- platform: uptime
|
- platform: template
|
||||||
name: Uptime
|
name: Doorbell
|
||||||
- platform: wifi_signal
|
id: doorbell
|
||||||
name: WiFi Signal
|
device_class: doorbell
|
||||||
update_interval: 10s
|
event_types:
|
||||||
|
- short
|
||||||
|
- double
|
||||||
|
- long
|
||||||
|
on_event:
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
- switch.is_on: chime_active
|
||||||
|
then:
|
||||||
|
- switch.turn_on: relay
|
||||||
|
- light.turn_on:
|
||||||
|
id: ring
|
||||||
|
red: 0
|
||||||
|
green: 1
|
||||||
|
blue: 0.7
|
||||||
|
effect: pulse
|
||||||
|
- delay: 0.2s
|
||||||
|
- switch.turn_off: relay
|
||||||
|
- delay: 5s
|
||||||
|
- light.turn_off: ring
|
||||||
|
|
||||||
globals:
|
globals:
|
||||||
- id: chime
|
- id: should_ring
|
||||||
type: bool
|
type: bool
|
||||||
restore_value: True
|
restore_value: True
|
||||||
initial_value: 'true'
|
initial_value: 'true'
|
||||||
|
@ -42,60 +66,56 @@ switch:
|
||||||
name: Chime Active
|
name: Chime Active
|
||||||
restore_mode: RESTORE_DEFAULT_ON
|
restore_mode: RESTORE_DEFAULT_ON
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return id(chime);
|
return id(should_ring);
|
||||||
turn_on_action:
|
turn_on_action:
|
||||||
- globals.set:
|
- globals.set:
|
||||||
id: chime
|
id: should_ring
|
||||||
value: 'true'
|
value: 'true'
|
||||||
turn_off_action:
|
turn_off_action:
|
||||||
- globals.set:
|
- globals.set:
|
||||||
id: chime
|
id: should_ring
|
||||||
value: 'false'
|
value: 'false'
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: push_button
|
id: button_doorbell
|
||||||
|
internal: True
|
||||||
pin:
|
pin:
|
||||||
number: GPIO15
|
number: GPIO15
|
||||||
mode:
|
mode:
|
||||||
input: True
|
input: True
|
||||||
pulldown: True
|
pulldown: True
|
||||||
filters:
|
filters:
|
||||||
- delayed_on: 50ms
|
- delayed_on: 20ms
|
||||||
- delayed_off: 8s
|
- delayed_off: 20ms
|
||||||
on_press:
|
on_multi_click:
|
||||||
then:
|
# Single Short Click
|
||||||
- light.turn_on:
|
- timing:
|
||||||
id: ring
|
- ON for at most 750ms
|
||||||
red: 0
|
- OFF for at least 300ms
|
||||||
green: 1
|
then:
|
||||||
blue: 0.7
|
- event.trigger:
|
||||||
effect: pulse
|
id: doorbell
|
||||||
- button.press: chime_button
|
event_type: short
|
||||||
on_release:
|
|
||||||
then:
|
|
||||||
- light.turn_off:
|
|
||||||
id: ring
|
|
||||||
transition_length: 1s
|
|
||||||
- platform: status
|
|
||||||
name: Status
|
|
||||||
|
|
||||||
button:
|
# Double Click: two quick presses
|
||||||
- platform: template
|
- timing:
|
||||||
id: chime_button
|
- ON for at most 750ms
|
||||||
name: Ring
|
- OFF for at most 300ms
|
||||||
icon: mdi:bell
|
- ON for at most 750ms
|
||||||
on_press:
|
- OFF for at least 300ms
|
||||||
then:
|
then:
|
||||||
- if:
|
- event.trigger:
|
||||||
condition:
|
id: doorbell
|
||||||
- switch.is_on: chime_active
|
event_type: double
|
||||||
then:
|
|
||||||
- switch.turn_on: relay
|
# Long Press only
|
||||||
- delay: 0.3s
|
- timing:
|
||||||
- switch.turn_off: relay
|
- ON for at least 750ms
|
||||||
- platform: restart
|
then:
|
||||||
name: Restart
|
- event.trigger:
|
||||||
|
id: doorbell
|
||||||
|
event_type: long
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: ledc
|
- platform: ledc
|
||||||
|
@ -125,4 +145,4 @@ light:
|
||||||
transition_length: 1s
|
transition_length: 1s
|
||||||
update_interval: 1s
|
update_interval: 1s
|
||||||
default_transition_length:
|
default_transition_length:
|
||||||
milliseconds: 200
|
milliseconds: 100
|
||||||
|
|
64
smart-meter-reader.yaml
Normal file
64
smart-meter-reader.yaml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
esphome:
|
||||||
|
name: smart-meter
|
||||||
|
friendly_name: Smart Meter
|
||||||
|
name_add_mac_suffix: True
|
||||||
|
|
||||||
|
packages: !include common/base.yaml
|
||||||
|
|
||||||
|
esp8266:
|
||||||
|
board: d1_mini
|
||||||
|
|
||||||
|
logger:
|
||||||
|
baud_rate: 0
|
||||||
|
level: INFO
|
||||||
|
api:
|
||||||
|
|
||||||
|
ota:
|
||||||
|
- platform: esphome
|
||||||
|
password: !secret ota_password
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
ssid: !secret wifi_ssid
|
||||||
|
password: !secret wifi_password
|
||||||
|
ap:
|
||||||
|
ssid: Smart Meter Fallback Hotspot
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: sml
|
||||||
|
name: Total Energy Consumed
|
||||||
|
obis_code: 1-0:1.8.0
|
||||||
|
unit_of_measurement: kWh
|
||||||
|
accuracy_decimals: 1
|
||||||
|
device_class: energy
|
||||||
|
state_class: total_increasing
|
||||||
|
filters:
|
||||||
|
- multiply: 0.0001
|
||||||
|
- platform: sml
|
||||||
|
name: Current Power
|
||||||
|
obis_code: 1-0:16.7.0
|
||||||
|
unit_of_measurement: W
|
||||||
|
accuracy_decimals: 0
|
||||||
|
device_class: power
|
||||||
|
state_class: measurement
|
||||||
|
filters:
|
||||||
|
- multiply: 0.01
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- platform: sml
|
||||||
|
name: Manufacturer
|
||||||
|
obis_code: 1-0:96.50.1
|
||||||
|
format: text
|
||||||
|
# - platform: sml
|
||||||
|
# name: Serial Number
|
||||||
|
# obis_code: 1-0:96.1.0
|
||||||
|
# format: text
|
||||||
|
|
||||||
|
uart:
|
||||||
|
id: uart_main
|
||||||
|
tx_pin: TX
|
||||||
|
rx_pin: RX
|
||||||
|
baud_rate: 9600
|
||||||
|
|
||||||
|
sml:
|
||||||
|
uart_id: uart_main
|
||||||
|
id: sml_main
|
Loading…
Add table
Reference in a new issue