Compare commits

..

No commits in common. "213469defa6d7c60a2ded73b12302b4e865d7b47" and "b26d01d38716f73d2899263ee3c1a2c51f417174" have entirely different histories.

3 changed files with 47 additions and 162 deletions

View file

@ -1,31 +0,0 @@
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

View file

@ -5,14 +5,10 @@ esphome:
esp32:
board: esp32dev
framework:
type: esp-idf
packages: !include common/base.yaml
# Enable Home Assistant API
api:
logger:
web_server:
ota:
- platform: esphome
@ -22,35 +18,15 @@ wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
event:
- platform: template
name: Doorbell
id: doorbell
device_class: doorbell
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
sensor:
- platform: uptime
name: Uptime
- platform: wifi_signal
name: WiFi Signal
update_interval: 10s
globals:
- id: should_ring
- id: chime
type: bool
restore_value: True
initial_value: 'true'
@ -66,56 +42,60 @@ switch:
name: Chime Active
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(should_ring);
return id(chime);
turn_on_action:
- globals.set:
id: should_ring
id: chime
value: 'true'
turn_off_action:
- globals.set:
id: should_ring
id: chime
value: 'false'
binary_sensor:
- platform: gpio
id: button_doorbell
internal: True
id: push_button
pin:
number: GPIO15
mode:
input: True
pulldown: True
filters:
- delayed_on: 20ms
- delayed_off: 20ms
on_multi_click:
# Single Short Click
- timing:
- ON for at most 750ms
- OFF for at least 300ms
- delayed_on: 50ms
- delayed_off: 8s
on_press:
then:
- event.trigger:
id: doorbell
event_type: short
- light.turn_on:
id: ring
red: 0
green: 1
blue: 0.7
effect: pulse
- button.press: chime_button
on_release:
then:
- light.turn_off:
id: ring
transition_length: 1s
- platform: status
name: Status
# Double Click: two quick presses
- timing:
- ON for at most 750ms
- OFF for at most 300ms
- ON for at most 750ms
- OFF for at least 300ms
button:
- platform: template
id: chime_button
name: Ring
icon: mdi:bell
on_press:
then:
- event.trigger:
id: doorbell
event_type: double
# Long Press only
- timing:
- ON for at least 750ms
- if:
condition:
- switch.is_on: chime_active
then:
- event.trigger:
id: doorbell
event_type: long
- switch.turn_on: relay
- delay: 0.3s
- switch.turn_off: relay
- platform: restart
name: Restart
output:
- platform: ledc
@ -145,4 +125,4 @@ light:
transition_length: 1s
update_interval: 1s
default_transition_length:
milliseconds: 100
milliseconds: 200

View file

@ -1,64 +0,0 @@
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