updating configuration
This commit is contained in:
@@ -4,11 +4,11 @@ import globals
|
||||
#
|
||||
# Home and away report
|
||||
# Send report about home state after presence_actions was done.
|
||||
#
|
||||
#
|
||||
# Args:
|
||||
# entity - group of entities to send state report
|
||||
# notify - notify entity to send message
|
||||
#
|
||||
#
|
||||
# Release Notes
|
||||
#
|
||||
# Version 1.0:
|
||||
@@ -32,7 +32,7 @@ class ReportByPresence(hass.Hass):
|
||||
def return_home_mode(self, event_id, event_args, kwargs):
|
||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||
return
|
||||
self.notify("Добро пожаловать домой!", name = self.args['notify'])
|
||||
globals.send_telegram(self, "Добро пожаловать домой!", target = self.args['notify'])
|
||||
|
||||
############# AWAY REPORT ##########################
|
||||
def send_report(self, kwargs):
|
||||
@@ -46,6 +46,6 @@ class ReportByPresence(hass.Hass):
|
||||
message += '{} ({}) = {}\n'.format(self.friendly_name(entity), entity, self.get_state(entity))
|
||||
if any:
|
||||
message = "В доме остались работать следующие устройства:\n" + message
|
||||
self.notify(message, name = self.args['notify'])
|
||||
globals.send_telegram(self, message, target = self.args['notify'])
|
||||
else:
|
||||
self.notify("Все устройства в доме выключены.", name = self.args['notify'])
|
||||
globals.send_telegram(self, "Все устройства в доме выключены.", target = self.args['notify'])
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import appdaemon.plugins.hass.hassapi as hass
|
||||
import datetime
|
||||
import globals
|
||||
|
||||
#
|
||||
# Water control application.
|
||||
# Controls water valve when all leave and no water needed devices is working.
|
||||
#
|
||||
#
|
||||
# Args:
|
||||
# water_valve = water valve entity
|
||||
# notify - notify entity to send message
|
||||
# constraint (optional) = input_boolean to enable\disable this automation
|
||||
#
|
||||
#
|
||||
# Release Notes
|
||||
#
|
||||
# Version 1.0:
|
||||
@@ -56,11 +57,11 @@ class WaterValveControl(hass.Hass):
|
||||
if name is None:
|
||||
name = device
|
||||
device_names += name
|
||||
self.notify('В доме остались требующие воды устройства ({}), подача воды не будет отключена.'.format(device_names), name = self.args['notify'])
|
||||
globals.send_telegram(self, 'В доме остались требующие воды устройства ({}), подача воды не будет отключена.'.format(device_names), target = self.args['notify'])
|
||||
self.cancel_current_timer()
|
||||
self.timers.append(self.run_every(self.wait_when_device_is_done, self.datetime()+datetime.timedelta(seconds=5), 5*60))
|
||||
else:
|
||||
self.notify('Отключаю подачу воды.', name = self.args['notify'])
|
||||
globals.send_telegram(self, 'Отключаю подачу воды.', target = self.args['notify'])
|
||||
self.turn_off(self.args['water_valve'])
|
||||
# for device in self.args['water_devices']:
|
||||
# self.turn_off(device)
|
||||
@@ -77,7 +78,7 @@ class WaterValveControl(hass.Hass):
|
||||
self.current_wait_cycle = self.current_wait_cycle+1
|
||||
elif len(powered_on) == 0 and self.current_wait_cycle>=self.wait_cycles:
|
||||
self.current_wait_cycle = 0
|
||||
self.notify('Устройства требующие воды закончили свою работу, отключаю подачу воды.', name = self.args['notify'])
|
||||
globals.send_telegram(self, 'Устройства требующие воды закончили свою работу, отключаю подачу воды.', target = self.args['notify'])
|
||||
self.turn_off_water_devices()
|
||||
self.cancel_current_timer()
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ water_action:
|
||||
constraint: input_boolean.water_control
|
||||
water_devices:
|
||||
- binary_sensor.washer_running # стиралка
|
||||
- binary_sensor.hc_dishwasher_running # посудомойка
|
||||
- binary_sensor.bosch_dishwasher_running # посудомойка
|
||||
global_dependencies:
|
||||
- globals
|
||||
Reference in New Issue
Block a user