M
# 2019-10-15 16:13:40.322555 INFO dishwasher: callback
# 2019-10-15 16:13:40.323649 INFO dishwasher: set timer
# 2019-10-15 16:13:40.324430 INFO dishwasher: running set timer
Size: a a a
M
PY
PY
PY
M
PY
PY
AS
PY
M
M
PY
M
def initialize(self):
self.buttons = {
id:[кнопка, свет, тип нажатия ,инпут]
}
def callback(self, event_name, data, kwargs):
for button in self.buttons:
if data['entity_id'] == self.buttons[button][0] and self.get_state(self.buttons[button][3]) == 'on' and data['click_type'] == self.buttons[button][2]:
self.toggle(self.buttons[button][1])
M
M
A
M
- platform: template
scan_interval: 70
sensors:
dver_of_329_last_use:
entity_id: binary_sensor.dver_of_329
friendly_name: "Дверь: последнее использование"
icon_template: mdi:clock-outline
#value_template: '{{ ((as_timestamp(now()) - as_timestamp(states.binary_sensor.dver_of_329.last_changed) ) | int ) / 3600 }}'
#value_template: '{{ states.binary_sensor.dver_of_329.last_changed }}'
value_template: "{{ relative_time(states.binary_sensor.dver_of_329.last_changed) }}"
И
AS