updating configuration
This commit is contained in:
@@ -32,7 +32,7 @@ class Intercom(hass.Hass):
|
||||
self.listen_state(self.sensor_trigger, self.args['sensor'])
|
||||
|
||||
def sensor_trigger(self, entity, attribute, old, new, kwargs):
|
||||
if new != "off":
|
||||
if new != "on":
|
||||
return
|
||||
self.log("domofon_call")
|
||||
self.domofon_call(None, None, None)
|
||||
|
||||
@@ -20,7 +20,7 @@ watchdog_wemos_uptime:
|
||||
constraint: input_boolean.watchdog_report
|
||||
entities:
|
||||
- sensor.airfresher_uptime
|
||||
- sensor.uptime_bath
|
||||
- sensor.watercontrol_uptime
|
||||
- sensor.domofon_uptime
|
||||
- sensor.uptime_kitchen_led
|
||||
- sensor.uptime_nest
|
||||
|
||||
@@ -41,6 +41,8 @@ binary_sensor:
|
||||
name: "Domofon incoming call"
|
||||
id: incoming_call
|
||||
device_class: lock
|
||||
filters:
|
||||
- delayed_off: 5s
|
||||
on_press:
|
||||
then:
|
||||
- script.execute: state_call
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# Need to turn off logging because senseair uses uart and have conflicts with logging
|
||||
logger:
|
||||
|
||||
esphome:
|
||||
name: watercontrol
|
||||
platform: ESP8266
|
||||
board: d1_mini
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_24_name
|
||||
password: !secret wifi_24_pass
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "Watercontrol Fallback Hotspot"
|
||||
password: !secret esphome_captive_pass
|
||||
|
||||
captive_portal:
|
||||
|
||||
# Enable Home Assistant API
|
||||
api:
|
||||
password: !secret esphome_pass
|
||||
|
||||
ota:
|
||||
password: !secret esphome_pass
|
||||
|
||||
|
||||
globals:
|
||||
- id: water_state
|
||||
type: bool
|
||||
restore_value: yes
|
||||
initial_value: 'true'
|
||||
- id: cold_value
|
||||
type: float
|
||||
restore_value: yes
|
||||
initial_value: '210.29'
|
||||
- id: hot_value
|
||||
type: float
|
||||
restore_value: yes
|
||||
initial_value: '109.74'
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: pulse_cold
|
||||
pin:
|
||||
number: D1
|
||||
mode: INPUT_PULLUP
|
||||
filters:
|
||||
- delayed_off: 100ms
|
||||
on_press:
|
||||
then:
|
||||
- lambda: 'id(cold_value) += 0.01;'
|
||||
|
||||
- platform: gpio
|
||||
name: pulse_hot
|
||||
pin:
|
||||
number: D2
|
||||
mode: INPUT_PULLUP
|
||||
filters:
|
||||
- delayed_off: 100ms
|
||||
on_press:
|
||||
then:
|
||||
- lambda: 'id(hot_value) += 0.01;'
|
||||
|
||||
sensor:
|
||||
- platform: uptime
|
||||
name: "Watercontrol Uptime"
|
||||
|
||||
- platform: template
|
||||
name: "counter hot"
|
||||
lambda: |-
|
||||
return id(hot_value);
|
||||
update_interval: 60s
|
||||
|
||||
- platform: template
|
||||
name: "counter cold"
|
||||
lambda: |-
|
||||
return id(cold_value);
|
||||
update_interval: 60s
|
||||
|
||||
- platform: ultrasonic
|
||||
trigger_pin: D7
|
||||
echo_pin: D6
|
||||
name: "Toilet Distance"
|
||||
update_interval: 5s
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: D5
|
||||
inverted: yes
|
||||
id: water_open
|
||||
interlock: [water_close]
|
||||
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: D3
|
||||
inverted: yes
|
||||
id: water_close
|
||||
interlock: [water_open]
|
||||
|
||||
- platform: template
|
||||
name: "Water valve"
|
||||
icon: "mdi:cup-water"
|
||||
lambda: |-
|
||||
return id(water_state);
|
||||
turn_on_action:
|
||||
- switch.turn_on: water_open
|
||||
- delay: 5s
|
||||
- switch.turn_off: water_open
|
||||
- lambda: 'id(water_state) = true;'
|
||||
turn_off_action:
|
||||
- switch.turn_on: water_close
|
||||
- delay: 5s
|
||||
- switch.turn_off: water_close
|
||||
- lambda: 'id(water_state) = false;'
|
||||
@@ -1,13 +1,13 @@
|
||||
#################################################
|
||||
# WATER #
|
||||
#################################################
|
||||
- platform: mqtt
|
||||
state_topic: 'home/bath/bath/cold'
|
||||
name: 'counter_cold'
|
||||
value_template: '{{ (value | float ) / 1000 }}'
|
||||
unit_of_measurement: 'm3'
|
||||
- platform: mqtt
|
||||
state_topic: 'home/bath/bath/hot'
|
||||
name: 'counter_hot'
|
||||
value_template: '{{ (value | float ) / 1000 }}'
|
||||
unit_of_measurement: 'm3'
|
||||
# - platform: mqtt
|
||||
# state_topic: 'home/bath/bath/cold'
|
||||
# name: 'counter_cold'
|
||||
# value_template: '{{ (value | float ) / 1000 }}'
|
||||
# unit_of_measurement: 'm3'
|
||||
# - platform: mqtt
|
||||
# state_topic: 'home/bath/bath/hot'
|
||||
# name: 'counter_hot'
|
||||
# value_template: '{{ (value | float ) / 1000 }}'
|
||||
# unit_of_measurement: 'm3'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
- platform: mqtt
|
||||
name: water_valve
|
||||
state_topic: "home/bath/bath/valve"
|
||||
command_topic: "home/bath/bath/valve/set"
|
||||
payload_on: "open"
|
||||
payload_off: "close"
|
||||
optimistic: false
|
||||
retain: false
|
||||
# - platform: mqtt
|
||||
# name: water_valve
|
||||
# state_topic: "home/bath/bath/valve"
|
||||
# command_topic: "home/bath/bath/valve/set"
|
||||
# payload_on: "open"
|
||||
# payload_off: "close"
|
||||
# optimistic: false
|
||||
# retain: false
|
||||
|
||||
Reference in New Issue
Block a user