updating configuration
This commit is contained in:
@@ -72,3 +72,18 @@ def turn_off(self, entity_id, state):
|
|||||||
def notification(self, to, message):
|
def notification(self, to, message):
|
||||||
self.notify(message, name = "telegram")
|
self.notify(message, name = "telegram")
|
||||||
|
|
||||||
|
|
||||||
|
def get_arg(args, key):
|
||||||
|
key = args[key]
|
||||||
|
return key
|
||||||
|
|
||||||
|
|
||||||
|
def get_arg_list(args, key):
|
||||||
|
arg_list = []
|
||||||
|
if isinstance(args[key], list):
|
||||||
|
arg = args[key]
|
||||||
|
else:
|
||||||
|
arg = (args[key]).split(",")
|
||||||
|
for key in arg:
|
||||||
|
arg_list.append(key)
|
||||||
|
return arg_list
|
||||||
@@ -55,7 +55,7 @@ class Groups(hass.Hass):
|
|||||||
entitylist.sort(key=self.sortByFriendlyName)
|
entitylist.sort(key=self.sortByFriendlyName)
|
||||||
|
|
||||||
self.log("Creating group {} with entities: {}".format(name, entitylist))
|
self.log("Creating group {} with entities: {}".format(name, entitylist))
|
||||||
self.set_state(name,state="on",attributes={"view": view,"hidden": hidden,"assumed_state": assumed_state,"friendly_name": friendly_name,"entity_id": entitylist})
|
self.set_state(name,state="on",attributes={"view": view,"hidden": hidden,"assumed_state": assumed_state,"friendly_name": friendly_name,"entity_id": entitylist, 'description': 'Created and updated from appdaemon ({})'.format(__name__)})
|
||||||
|
|
||||||
def sortByFriendlyName(self, entity):
|
def sortByFriendlyName(self, entity):
|
||||||
return self.get_state(entity, 'friendly_name')
|
return self.get_state(entity, 'friendly_name')
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ class LightButton(hass.Hass):
|
|||||||
self.set_on(entity_id)
|
self.set_on(entity_id)
|
||||||
|
|
||||||
def set_on(self, entity_id):
|
def set_on(self, entity_id):
|
||||||
if entity_id.startswith("light"):
|
if entity_id.startswith("light") and 'color' in entity_id:
|
||||||
|
self.call_service("light/turn_on", entity_id = entity_id, transition = 1, brightness = 255, color_temp=204)
|
||||||
|
elif entity_id.startswith("light"):
|
||||||
self.call_service("light/turn_on", entity_id = entity_id, transition = 1, brightness = 255)
|
self.call_service("light/turn_on", entity_id = entity_id, transition = 1, brightness = 255)
|
||||||
else:
|
else:
|
||||||
self.turn_on(entity_id)
|
self.turn_on(entity_id)
|
||||||
|
|||||||
@@ -1,56 +1,55 @@
|
|||||||
import datetime
|
import datetime
|
||||||
from automation import Automation, Base # type: ignore
|
from automation import Automation, Base # type: ignore
|
||||||
|
|
||||||
#
|
#
|
||||||
# App to send email report for low balance
|
# App to send email report for low balance
|
||||||
#
|
#
|
||||||
# Args:
|
# Args:
|
||||||
#
|
#
|
||||||
# threshold = value below which battery levels are reported and email is sent
|
# threshold = value below which battery levels are reported and email is sent
|
||||||
# always_send = set to 1 to override threshold and force send
|
# always_send = set to 1 to override threshold and force send
|
||||||
#
|
#
|
||||||
# None
|
# None
|
||||||
#
|
#
|
||||||
# Release Notes
|
# Release Notes
|
||||||
#
|
#
|
||||||
# Version 1.0:
|
# Version 1.0:
|
||||||
# Initial Version
|
# Initial Version
|
||||||
|
|
||||||
class Balance(Base):
|
class Balance(Base):
|
||||||
|
def initialize(self):
|
||||||
def initialize(self):
|
super().initialize()
|
||||||
super().initialize()
|
self.check_balance({"force": 1})
|
||||||
self.check_balance({"force": 1})
|
self.run_daily(self.check_balance, datetime.time(10, 0, 0))
|
||||||
self.run_daily(self.check_balance, datetime.time(10, 0, 0))
|
|
||||||
|
def check_balance(self, kwargs):
|
||||||
def check_balance(self, kwargs):
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
return
|
||||||
return
|
|
||||||
|
values = {}
|
||||||
values = {}
|
low = []
|
||||||
low = []
|
for key in self.entity_ids:
|
||||||
for key in self.entity_ids:
|
device = self.entity_ids[key]
|
||||||
device = self.entity_ids[key]
|
balance = self.get_state(device)
|
||||||
balance = self.get_state(device)
|
if balance != None and self.is_number(balance):
|
||||||
if balance != None and self.is_number(balance):
|
if float(balance) < self.args["threshold"]:
|
||||||
if float(balance) < self.args["threshold"]:
|
low.append(device)
|
||||||
low.append(device)
|
values[device] = balance
|
||||||
values[device] = balance
|
|
||||||
|
message=""
|
||||||
message=""
|
if low:
|
||||||
if low:
|
message += "Пожалуйста пополните баланс: (< {}) \n".format(self.args["threshold"])
|
||||||
message += "Пожалуйста пополните баланс: (< {}) \n".format(self.args["threshold"])
|
for device in low:
|
||||||
for device in low:
|
message += " - {}: {}\n".format(self.friendly_name(device), values[device])
|
||||||
message += " - {}: {}\n".format(self.friendly_name(device), values[device])
|
message += "\n\n"
|
||||||
message += "\n\n"
|
|
||||||
|
if low or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1):
|
||||||
if low or ("always_send" in self.args and self.args["always_send"] == 1) or ("force" in kwargs and kwargs["force"] == 1):
|
if message != "":
|
||||||
if message != "":
|
self.notify(message, name = "telegram") #name = "telegram_monster"
|
||||||
self.notify(message, name = "telegram") #name = "telegram_monster"
|
|
||||||
|
def is_number(self, s):
|
||||||
def is_number(self, s):
|
try:
|
||||||
try:
|
float(s)
|
||||||
float(s)
|
return True
|
||||||
return True
|
except ValueError:
|
||||||
except ValueError:
|
|
||||||
return False
|
return False
|
||||||
@@ -26,22 +26,22 @@ class WaterCountersAlarm(hass.Hass):
|
|||||||
self.send_threasold = self.args['send_threasold']
|
self.send_threasold = self.args['send_threasold']
|
||||||
|
|
||||||
self.check_send_dates({"force": 1})
|
self.check_send_dates({"force": 1})
|
||||||
time = datetime.time(10, 0, 0)
|
self.run_daily(self.check_checkup_dates, datetime.time(10, 0, 0))
|
||||||
self.run_daily(self.check_checkup_dates, time)
|
self.run_daily(self.check_send_dates, datetime.time(10, 1, 0))
|
||||||
self.run_daily(self.check_send_dates, time)
|
#self.check_checkup_dates([])
|
||||||
# self.check_send_dates([])
|
|
||||||
|
|
||||||
def check_send_dates(self, kwargs):
|
def check_send_dates(self, kwargs):
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
return
|
return
|
||||||
devices = self.get_state()
|
devices = self.get_state()
|
||||||
|
if devices == None:
|
||||||
|
return
|
||||||
values = {}
|
values = {}
|
||||||
send_devices = []
|
send_devices = []
|
||||||
for deviceName in devices:
|
for deviceName in devices:
|
||||||
device = devices[deviceName]
|
device = devices[deviceName]
|
||||||
if (device == None):
|
if (device == None):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
send_date = None
|
send_date = None
|
||||||
if "attributes" in device:
|
if "attributes" in device:
|
||||||
if "date" in device["attributes"]:
|
if "date" in device["attributes"]:
|
||||||
@@ -75,20 +75,27 @@ class WaterCountersAlarm(hass.Hass):
|
|||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
return
|
return
|
||||||
|
|
||||||
devices = self.get_state()
|
entities = self.get_state()
|
||||||
|
if entities == None:
|
||||||
|
return
|
||||||
|
|
||||||
values = {}
|
values = {}
|
||||||
checkup_devices = []
|
checkup_devices = []
|
||||||
for device in devices:
|
for entity_id in entities:
|
||||||
|
entity = entities[entity_id]
|
||||||
|
if entity == None:
|
||||||
|
# self.log('not found {} in entities list.'.format(entity_id))
|
||||||
|
continue
|
||||||
checkup = None
|
checkup = None
|
||||||
if "attributes" in devices[device]:
|
if "attributes" in entity:
|
||||||
if "checkup" in devices[device]["attributes"]:
|
if "checkup" in entity["attributes"]:
|
||||||
checkup = devices[device]["attributes"]["checkup"]
|
checkup = entity["attributes"]["checkup"]
|
||||||
if checkup != None:
|
if checkup != None:
|
||||||
self.log('found device {} with checkup date {}'.format(device, checkup))
|
self.log('found device {} with checkup date {}'.format(entity_id, checkup))
|
||||||
checkup_date = datetime.datetime.strptime(checkup, '%Y-%m-%d')
|
checkup_date = datetime.datetime.strptime(checkup, '%Y-%m-%d')
|
||||||
if (checkup_date - datetime.timedelta(days=self.checkup_threasold)) < datetime.datetime.now():
|
if (checkup_date - datetime.timedelta(days=self.checkup_threasold)) < datetime.datetime.now():
|
||||||
checkup_devices.append(device)
|
checkup_devices.append(entity_id)
|
||||||
values[device] = checkup
|
values[entity_id] = checkup
|
||||||
|
|
||||||
message=""
|
message=""
|
||||||
if checkup_devices:
|
if checkup_devices:
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ class Purifier(hass.Hass):
|
|||||||
self.listen_event_handle_list.append(self.listen_state(self.state_change, self.args['entity'], attribute='illuminance'))
|
self.listen_event_handle_list.append(self.listen_state(self.state_change, self.args['entity'], attribute='illuminance'))
|
||||||
|
|
||||||
def state_change(self, entity, attribute, old, new, kwargs):
|
def state_change(self, entity, attribute, old, new, kwargs):
|
||||||
|
presence_state = self.get_state(self.args['ha_panel'])
|
||||||
|
if presence_state != "disarmed":
|
||||||
|
# self.log('Nobody home, ignoring illuminance changes.')
|
||||||
|
return
|
||||||
self.log("{} changed from {} to {}".format(attribute, old, new))
|
self.log("{} changed from {} to {}".format(attribute, old, new))
|
||||||
if old > 0 and new == 0 and self.time_is_between(self.datetime(), self.args["on_time"], self.args["off_time"]):
|
if old > 0 and new == 0 and self.time_is_between(self.datetime(), self.args["on_time"], self.args["off_time"]):
|
||||||
self.night_mode()
|
self.night_mode()
|
||||||
@@ -61,7 +65,7 @@ class Purifier(hass.Hass):
|
|||||||
self.call_service("fan/set_speed", entity_id = self.args['entity'], speed='favorite')
|
self.call_service("fan/set_speed", entity_id = self.args['entity'], speed='favorite')
|
||||||
self.call_service("fan/xiaomi_miio_set_favorite_level", entity_id = self.args['entity'], level=self.away_fan_speed)
|
self.call_service("fan/xiaomi_miio_set_favorite_level", entity_id = self.args['entity'], level=self.away_fan_speed)
|
||||||
self.call_service("fan/xiaomi_miio_set_led_on", entity_id = self.args['entity'])
|
self.call_service("fan/xiaomi_miio_set_led_on", entity_id = self.args['entity'])
|
||||||
self.call_service("fan/xiaomi_miio_set_buzzer_on", entity_id = self.args['entity'])
|
# self.call_service("fan/xiaomi_miio_set_buzzer_on", entity_id = self.args['entity'])
|
||||||
|
|
||||||
def auto_mode(self):
|
def auto_mode(self):
|
||||||
self.mode='auto'
|
self.mode='auto'
|
||||||
@@ -69,7 +73,7 @@ class Purifier(hass.Hass):
|
|||||||
if 'entity' in self.args:
|
if 'entity' in self.args:
|
||||||
self.call_service("fan/set_speed", entity_id = self.args['entity'], speed='auto')
|
self.call_service("fan/set_speed", entity_id = self.args['entity'], speed='auto')
|
||||||
self.call_service("fan/xiaomi_miio_set_led_on", entity_id = self.args['entity'])
|
self.call_service("fan/xiaomi_miio_set_led_on", entity_id = self.args['entity'])
|
||||||
self.call_service("fan/xiaomi_miio_set_buzzer_on", entity_id = self.args['entity'])
|
# self.call_service("fan/xiaomi_miio_set_buzzer_on", entity_id = self.args['entity'])
|
||||||
|
|
||||||
def night_mode(self):
|
def night_mode(self):
|
||||||
self.mode='night'
|
self.mode='night'
|
||||||
|
|||||||
@@ -4,5 +4,6 @@ purifier_timer:
|
|||||||
on_time: "06:45:00"
|
on_time: "06:45:00"
|
||||||
off_time: "23:00:00"
|
off_time: "23:00:00"
|
||||||
entity: fan.xiaomi_miio_device
|
entity: fan.xiaomi_miio_device
|
||||||
|
ha_panel: alarm_control_panel.ha_alarm
|
||||||
global_dependencies:
|
global_dependencies:
|
||||||
- globals
|
- globals
|
||||||
@@ -28,10 +28,13 @@ class IntercomSwitch(hass.Hass):
|
|||||||
entity_id = self.args['entity_id']
|
entity_id = self.args['entity_id']
|
||||||
self.log("Somebody come home, turn on {}".format(entity_id))
|
self.log("Somebody come home, turn on {}".format(entity_id))
|
||||||
self.turn_on(entity_id)
|
self.turn_on(entity_id)
|
||||||
|
self.notify("Кто-то вернулся домой, включаю домофон.", name = self.args['notify'])
|
||||||
|
|
||||||
|
|
||||||
def leave_event(self, event_id, event_args, kwargs):
|
def leave_event(self, event_id, event_args, kwargs):
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
return
|
return
|
||||||
entity_id = self.args['entity_id']
|
entity_id = self.args['entity_id']
|
||||||
self.log("All persons leave home, turn off {}".format(entity_id))
|
self.log("All persons leave home, turn off {}".format(entity_id))
|
||||||
self.turn_off(entity_id)
|
self.turn_off(entity_id)
|
||||||
|
self.notify("Все ушли из дома, выключаю домофон", name = self.args['notify'])
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
intercom_auto_open:
|
intercom_auto_open:
|
||||||
module: intercom_switch
|
module: intercom_switch
|
||||||
class: IntercomSwitch
|
class: IntercomSwitch
|
||||||
|
notify: telegram_monster
|
||||||
entity_id: switch.domofon_mode
|
entity_id: switch.domofon_mode
|
||||||
arrive_event: homekit_home_arrive
|
arrive_event: homekit_home_arrive
|
||||||
leave_event: homekit_home_leave
|
leave_event: homekit_home_leave
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ class WorkTime(hass.Hass):
|
|||||||
self.run_timer()
|
self.run_timer()
|
||||||
|
|
||||||
def arrive_event(self, event_id, event_args, kwargs):
|
def arrive_event(self, event_id, event_args, kwargs):
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
|
||||||
return
|
|
||||||
if self.arrive_time != None:
|
if self.arrive_time != None:
|
||||||
self.log('You have already arrived to the work today at {}'.format(self.arrive_time))
|
self.log('You have already arrived to the work today at {}'.format(self.arrive_time))
|
||||||
self.run_timer()
|
self.run_timer()
|
||||||
@@ -49,6 +47,9 @@ class WorkTime(hass.Hass):
|
|||||||
self.run_timer()
|
self.run_timer()
|
||||||
self.log("Monster has arrived to work at {}, work till {}, will notify at {}.".format(self.arrive_time, self.leave_time, self.notify_time))
|
self.log("Monster has arrived to work at {}, work till {}, will notify at {}.".format(self.arrive_time, self.leave_time, self.notify_time))
|
||||||
self.timers.append(self.run_every(self.timer_tick, self.notify_time, self.notify_every_seconds))
|
self.timers.append(self.run_every(self.timer_tick, self.notify_time, self.notify_every_seconds))
|
||||||
|
|
||||||
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
|
return
|
||||||
self.notify("Добро пожаловать в офис. Сегодня работаешь до {}.".format(self.format_time(self.leave_time)), name = self.args['notify'])
|
self.notify("Добро пожаловать в офис. Сегодня работаешь до {}.".format(self.format_time(self.leave_time)), name = self.args['notify'])
|
||||||
|
|
||||||
def run_timer(self):
|
def run_timer(self):
|
||||||
@@ -60,8 +61,6 @@ class WorkTime(hass.Hass):
|
|||||||
self.timers.append(self.run_every(self.timer_tick, timer_start, self.notify_every_seconds))
|
self.timers.append(self.run_every(self.timer_tick, timer_start, self.notify_every_seconds))
|
||||||
|
|
||||||
def leave_event(self, event_id, event_args, kwargs):
|
def leave_event(self, event_id, event_args, kwargs):
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
|
||||||
return
|
|
||||||
if self.arrive_time == None:
|
if self.arrive_time == None:
|
||||||
return
|
return
|
||||||
self.cancel_timers()
|
self.cancel_timers()
|
||||||
@@ -78,14 +77,17 @@ class WorkTime(hass.Hass):
|
|||||||
else:
|
else:
|
||||||
self.log("Monster leave work at {} - {}".format(self.arrive_time, self.datetime))
|
self.log("Monster leave work at {} - {}".format(self.arrive_time, self.datetime))
|
||||||
message = "Рабочий день окончен ({}-{}). Приятной дороги домой.{}".format(self.format_time(self.arrive_time), self.format_time(self.datetime()), travelTime)
|
message = "Рабочий день окончен ({}-{}). Приятной дороги домой.{}".format(self.format_time(self.arrive_time), self.format_time(self.datetime()), travelTime)
|
||||||
|
|
||||||
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
|
return
|
||||||
self.notify(message, name = self.args['notify'])
|
self.notify(message, name = self.args['notify'])
|
||||||
# self.reset_timer_tick(None)
|
# self.reset_timer_tick(None)
|
||||||
|
|
||||||
def timer_tick(self, args) -> None:
|
def timer_tick(self, args) -> None:
|
||||||
self.log('timer tick')
|
self.log('timer tick')
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
if self.notify_time == None or self.datetime()<self.notify_time:
|
||||||
return
|
return
|
||||||
if self.datetime()<self.notify_time:
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
return
|
return
|
||||||
message = "Ты пришел на работу в {}, работаешь до {}. Пора домой!".format(self.format_time(self.arrive_time), self.format_time(self.leave_time))
|
message = "Ты пришел на работу в {}, работаешь до {}. Пора домой!".format(self.format_time(self.arrive_time), self.format_time(self.leave_time))
|
||||||
self.notify(message, name = self.args['notify'])
|
self.notify(message, name = self.args['notify'])
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import appdaemon.plugins.hass.hassapi as hass
|
||||||
|
|
||||||
|
#
|
||||||
|
# Helper for presence detection
|
||||||
|
#
|
||||||
|
# Args:
|
||||||
|
# ha_panel - alarm control panel entity (to arm and disarm).
|
||||||
|
#
|
||||||
|
# Release Notes
|
||||||
|
#
|
||||||
|
# Version 1.0:
|
||||||
|
# Initial Version
|
||||||
|
|
||||||
|
class Presence(hass.Hass):
|
||||||
|
def initialize(self):
|
||||||
|
self.log('started')
|
||||||
|
|
||||||
|
def function():
|
||||||
|
pass
|
||||||
@@ -20,17 +20,31 @@ import appdaemon.plugins.hass.hassapi as hass
|
|||||||
class WaterLeak(hass.Hass):
|
class WaterLeak(hass.Hass):
|
||||||
ringtone = 2
|
ringtone = 2
|
||||||
gw_mac = ''
|
gw_mac = ''
|
||||||
|
sensors = []
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
if 'sensor' not in self.args or 'valve' not in self.args or 'notify' not in self.args:
|
if 'sensor' not in self.args or 'valve' not in self.args or 'notify' not in self.args:
|
||||||
self.error("Please provide sensor, valve and notify in config!")
|
self.error("Please provide sensor, valve and notify in config!")
|
||||||
return
|
return
|
||||||
self.listen_state(self.water_leak, self.args['sensor'])
|
self.sensors = self.get_water_leak_sensors()
|
||||||
|
self.log("leak sensors: {}".format(self.sensors))
|
||||||
|
for sensor in self.sensors:
|
||||||
|
self.listen_state(self.water_leak, sensor)
|
||||||
|
|
||||||
|
def get_water_leak_sensors(self):
|
||||||
|
sensors = []
|
||||||
|
devices = self.get_state()
|
||||||
|
for sensor in devices:
|
||||||
|
if not sensor.startswith(self.args['sensor_prefix']):
|
||||||
|
continue
|
||||||
|
sensors.append(sensor)
|
||||||
|
return sensors
|
||||||
|
|
||||||
def water_leak(self, entity, attribute, old, new, kwargs):
|
def water_leak(self, entity, attribute, old, new, kwargs):
|
||||||
if new == "on":
|
if new == "on":
|
||||||
self.send_alarm()
|
self.send_alarm()
|
||||||
|
|
||||||
def send_alarm(self):
|
def send_alarm(self):
|
||||||
|
self.log('water leak alarm triggered!')
|
||||||
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
if 'constraint' in self.args and not self.constrain_input_boolean(self.args['constraint']):
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -44,10 +58,6 @@ class WaterLeak(hass.Hass):
|
|||||||
self.notify(message, name = self.args['notify'])
|
self.notify(message, name = self.args['notify'])
|
||||||
|
|
||||||
message = "Состояние датчиков протечки:\n"
|
message = "Состояние датчиков протечки:\n"
|
||||||
attributes = self.get_state(self.args['sensor'], attribute = "all")
|
for entity_id in self.sensors:
|
||||||
if 'attributes' in attributes:
|
message += '{} ({}) = {}\n'.format(self.friendly_name(entity_id), entity_id, self.get_state(entity_id))
|
||||||
attributes = attributes['attributes']
|
self.notify(message, name = self.args['notify'])
|
||||||
if 'entity_id' in attributes:
|
|
||||||
for entity_id in attributes["entity_id"]:
|
|
||||||
message += '{} ({}) = {}\n'.format(self.friendly_name(entity_id), entity_id, self.get_state(entity_id))
|
|
||||||
self.notify(message, name = self.args['notify'])
|
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ water_leak:
|
|||||||
module: water_leak
|
module: water_leak
|
||||||
class: WaterLeak
|
class: WaterLeak
|
||||||
constraint: input_boolean.water_leak_control
|
constraint: input_boolean.water_leak_control
|
||||||
sensor: group.water_leak
|
sensor: group.water_leak_sensors
|
||||||
valve: switch.water_valve
|
valve: switch.water_valve
|
||||||
|
sensor_prefix: binary_sensor.water_leak_sensor_
|
||||||
notify: telegram
|
notify: telegram
|
||||||
gw_mac: !secret aqara1_mac
|
gw_mac: !secret aqara1_mac
|
||||||
global_dependencies:
|
global_dependencies:
|
||||||
|
|||||||
+11
-1
@@ -44,7 +44,7 @@ services:
|
|||||||
max-size: 50m
|
max-size: 50m
|
||||||
|
|
||||||
hass:
|
hass:
|
||||||
image: homeassistant/home-assistant:0.100.2
|
image: homeassistant/home-assistant:0.100.3
|
||||||
container_name: hass
|
container_name: hass
|
||||||
volumes:
|
volumes:
|
||||||
- ./hass/settings:/config
|
- ./hass/settings:/config
|
||||||
@@ -61,6 +61,11 @@ services:
|
|||||||
- broadlink
|
- broadlink
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8123"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 6
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
@@ -181,3 +186,8 @@ services:
|
|||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
max-size: 50m
|
max-size: 50m
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external:
|
||||||
|
name: my-pre-existing-network
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- platform: ping
|
||||||
|
name: uptime_synology
|
||||||
|
host: !secret syno_ip
|
||||||
|
count: 2
|
||||||
|
scan_interval: 30
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
- platform: mpd
|
||||||
|
host: 192.168.1.125
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
- platform: synologydsm
|
||||||
|
host: !secret syno_ip
|
||||||
|
port: 5000
|
||||||
|
ssl: false
|
||||||
|
username: !secret syno_user
|
||||||
|
password: !secret syno_pass
|
||||||
|
monitored_conditions:
|
||||||
|
- cpu_total_load
|
||||||
@@ -11,4 +11,4 @@
|
|||||||
power_cost:
|
power_cost:
|
||||||
friendly_name: "Стоимость квт/ч"
|
friendly_name: "Стоимость квт/ч"
|
||||||
unit_of_measurement: 'Р'
|
unit_of_measurement: 'Р'
|
||||||
value_template: "4.37"
|
value_template: "4.65"
|
||||||
@@ -47,15 +47,15 @@
|
|||||||
power_money_t1_monthly:
|
power_money_t1_monthly:
|
||||||
friendly_name: "Т1 в мес."
|
friendly_name: "Т1 в мес."
|
||||||
unit_of_measurement: '₽'
|
unit_of_measurement: '₽'
|
||||||
value_template: "{{ (states('sensor.power_theory_t1') | float * 1.37) | round(2) }}"
|
value_template: "{{ (states('sensor.power_theory_t1') | float * 1.5) | round(2) }}"
|
||||||
power_money_t2_monthly:
|
power_money_t2_monthly:
|
||||||
friendly_name: "Т2 в мес."
|
friendly_name: "Т2 в мес."
|
||||||
unit_of_measurement: '₽'
|
unit_of_measurement: '₽'
|
||||||
value_template: "{{ (states('sensor.power_theory_t2') | float * 4.37) | round(2) }}"
|
value_template: "{{ (states('sensor.power_theory_t2') | float * 4.65) | round(2) }}"
|
||||||
power_money_t3_monthly:
|
power_money_t3_monthly:
|
||||||
friendly_name: "Т3 в мес."
|
friendly_name: "Т3 в мес."
|
||||||
unit_of_measurement: '₽'
|
unit_of_measurement: '₽'
|
||||||
value_template: "{{ (states('sensor.power_theory_t3') | float * 5.25) | round(2) }}"
|
value_template: "{{ (states('sensor.power_theory_t3') | float * 5.58) | round(2) }}"
|
||||||
power_theory_money_monthly:
|
power_theory_money_monthly:
|
||||||
friendly_name: "Итого в мес."
|
friendly_name: "Итого в мес."
|
||||||
unit_of_measurement: '₽'
|
unit_of_measurement: '₽'
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ work_coords: xxxxxxxxx
|
|||||||
# SYNOLOGY SETTINGS #
|
# SYNOLOGY SETTINGS #
|
||||||
###################################
|
###################################
|
||||||
syno_url: xxxxxxxxx
|
syno_url: xxxxxxxxx
|
||||||
|
syno_ip: xxxxxxxxx
|
||||||
syno_user: xxxxxxxxx
|
syno_user: xxxxxxxxx
|
||||||
syno_pass: xxxxxxxxx
|
syno_pass: xxxxxxxxx
|
||||||
rtsp_entrance: xxxxxxxxx
|
rtsp_entrance: xxxxxxxxx
|
||||||
|
|||||||
@@ -168,6 +168,11 @@ views:
|
|||||||
camera_image: camera.entrance
|
camera_image: camera.entrance
|
||||||
show_info: true
|
show_info: true
|
||||||
tap_action: dialog
|
tap_action: dialog
|
||||||
|
- type: entities
|
||||||
|
title: "Электропитание"
|
||||||
|
show_header_toggle: false
|
||||||
|
entities:
|
||||||
|
- media_player.mpd
|
||||||
- title: "Будильники"
|
- title: "Будильники"
|
||||||
icon: mdi:alarm
|
icon: mdi:alarm
|
||||||
cards:
|
cards:
|
||||||
@@ -302,6 +307,7 @@ views:
|
|||||||
title: "Теория трехтарифника"
|
title: "Теория трехтарифника"
|
||||||
show_header_toggle: false
|
show_header_toggle: false
|
||||||
entities:
|
entities:
|
||||||
|
- utility_meter.power_theory
|
||||||
- sensor.power_theory_t1
|
- sensor.power_theory_t1
|
||||||
- sensor.power_theory_t2
|
- sensor.power_theory_t2
|
||||||
- sensor.power_theory_t3
|
- sensor.power_theory_t3
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ serial: xxxxxxxxx
|
|||||||
disable_led: xxxxxxxxx
|
disable_led: xxxxxxxxx
|
||||||
advanced: xxxxxxxxx
|
advanced: xxxxxxxxx
|
||||||
cache_state: xxxxxxxxx
|
cache_state: xxxxxxxxx
|
||||||
|
# Optional: xxxxxxxxx
|
||||||
|
# unstable when executing many commands
|
||||||
|
queue: xxxxxxxxx
|
||||||
|
# Optional: xxxxxxxxx
|
||||||
|
delay: xxxxxxxxx
|
||||||
|
# Optional: xxxxxxxxx
|
||||||
|
simultaneously: xxxxxxxxx
|
||||||
devices: xxxxxxxxx
|
devices: xxxxxxxxx
|
||||||
'0x00158d0001e065e8': xxxxxxxxx
|
'0x00158d0001e065e8': xxxxxxxxx
|
||||||
friendly_name: xxxxxxxxx
|
friendly_name: xxxxxxxxx
|
||||||
@@ -23,3 +30,7 @@ devices: xxxxxxxxx
|
|||||||
'0x00158d00026ea017': xxxxxxxxx
|
'0x00158d00026ea017': xxxxxxxxx
|
||||||
friendly_name: xxxxxxxxx
|
friendly_name: xxxxxxxxx
|
||||||
retain: xxxxxxxxx
|
retain: xxxxxxxxx
|
||||||
|
'0x000d6ffffe2c61ce': xxxxxxxxx
|
||||||
|
friendly_name: xxxxxxxxx
|
||||||
|
debounce: xxxxxxxxx
|
||||||
|
retrieve_state: xxxxxxxxx
|
||||||
|
|||||||
Reference in New Issue
Block a user