Select Git revision
propbox-light.yaml
propbox-light.yaml 2.00 KiB
substitutions:
devicename: "propbox-light"
comment: "Propagator Light Control"
project_name: "groovy.propbox-light"
project_version: "1.0"
current_res: "0.00280" # Higher value gives lower watt readout
voltage_div: "775" # Lower value gives lower voltage readout
<<: !include common.yaml
esp8266:
board: esp8285
light:
- platform: status_led
id: "led_status"
pin:
number: GPIO13
inverted: true
binary_sensor:
# toggle relay on/off
- platform: gpio
id: "button_state"
pin:
number: GPIO00
mode: INPUT_PULLUP
on_press:
- switch.toggle: "button_switch"
switch:
- platform: template
name: "Switch"
optimistic: true
id: "button_switch"
lambda: |-
if (id(relay).state) {
return true;
} else {
return false;
}
turn_on_action:
- switch.turn_on: "relay"
- light.turn_on: "led_status"
turn_off_action:
- switch.turn_off: "relay"
- light.turn_off: "led_status"
- platform: gpio
id: relay
pin: GPIO14
sensor:
- platform: wifi_signal
name: "Wifi Signal"
update_interval: 60s
- platform: uptime
name: "Uptime"
update_interval: 60s
- platform: total_daily_energy
name: "Electric Consumption [kWh]"
power_id: "nous_a1t_watt"
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
- platform: adc