Created
July 8, 2020 14:16
-
-
Save bessarabov/745e31f20bb234bbaf6015e5045839af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input_number: | |
water_counter: | |
min: 0 | |
max: 100000000 | |
step: 10 | |
unit_of_measurement: liter | |
icon: mdi:water | |
water_counter_by_on: | |
min: 0 | |
max: 100000000 | |
step: 10 | |
unit_of_measurement: liter | |
icon: mdi:water | |
current_water_counter: | |
mode: box | |
min: 0 | |
max: 100000000 | |
unit_of_measurement: liter | |
icon: mdi:water | |
automation: | |
- id: increase_water_counter | |
alias: Increase water counter | |
trigger: | |
- platform: state | |
entity_id: binary_sensor.0x00158d0004470939_contact | |
to: 'off' | |
action: | |
- service: input_number.increment | |
data: | |
entity_id: input_number.water_counter | |
- id: increase_water_counter_by_on | |
alias: Increase water counter by on | |
trigger: | |
- platform: state | |
entity_id: binary_sensor.0x00158d0004470939_contact | |
to: 'on' | |
action: | |
- service: input_number.increment | |
data: | |
entity_id: input_number.water_counter_by_on | |
- alias: set water counter | |
trigger: | |
action: | |
- service: notify.bessarabov | |
data_template: | |
message: "Установка счетчика воды. Было: {{ states('input_number.water_counter') | int }} Стало: {{ states('input_number.current_water_counter') | int }} Разница: {{ states('input_number.current_water_counter') | int - states('input_number.water_counter') | int }}" | |
- service: input_number.set_value | |
data_template: | |
entity_id: input_number.water_counter | |
value: "{{ states('input_number.current_water_counter') | int }}" | |
utility_meter: | |
hourly_water: | |
source: input_number.water_counter | |
cycle: hourly | |
daily_water: | |
source: input_number.water_counter | |
cycle: daily | |
monthly_water: | |
source: input_number.water_counter | |
cycle: monthly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment