Skip to content

Instantly share code, notes, and snippets.

@vvv279
vvv279 / fw_mgl03_update.md
Created May 10, 2021 12:02 — forked from zvldz/fw_mgl03_update.md
Updating mgl03 gateway firmware from telnet

Updating mgl03 gateway firmware via telnet

Telnet must be opened on the gateway (via custom component from @AlexxIT or php-miio/python-miio). You need telnet client like putty or other. You can find out IP of the gateway in MiHome or on your router. Login - "admin", no password.

@vvv279
vvv279 / fridge.yaml
Created May 14, 2021 08:33 — forked from bessarabov/fridge.yaml
Датчики температуры в холодильнике для Home Assistant
binary_sensor:
- platform: template
sensors:
fridge_top_temperature_is_ok:
value_template: >-
{{ (states('sensor.0x00158d00045f5f93_temperature') | float > 5)
and (states('sensor.0x00158d00045f5f93_temperature') | float < 12) }}
fridge_bottom_temperature_is_ok:
@vvv279
vvv279 / radio.yaml
Created June 30, 2021 13:32 — forked from AlexxIT/radio.yaml
Список радиостанций для колонок Яндекса
input_select:
radio:
name: Радио
options: ['-']
icon: mdi:radio
python_script: # https://github.com/AlexxIT/PythonScriptsPro
automation:
trigger:
@vvv279
vvv279 / scripts_tts_yandex_station_say Home Assistant. Создаем скрипт для отображения сервисных шаблонов
# Колонка произнесёт текст с заданной громкостью и вернёт громкость на прежний уровень.
# Создаем скрипт для отображения сервисных шаблонов
# Интеграция: https://github.com/AlexxIT/YandexStation
# Документация: Passing variables to scripts https://www.home-assistant.io/integrations/script/#passing-variables-to-scripts
tts_yandex_station_say:
alias: TTS Яндекс колонка
fields:
device:
name: Выберите свою колонку
required: true
1) Создаем папку python_scripts в config
2) Создаем текстовый файлик с именем shopping_list.txt и переименовываем расширение с txt на py. Должно получиться shopping_list.py
3) Вставляем этот код, который будет считывать данные с файлика .shopping_list.json
#!/usr/local/bin/python
# coding: utf8
import json
with open('/config/.shopping_list.json') as data_file:
shoppingListData = json.load(data_file)
@vvv279
vvv279 / Скрипт для взаимодействия пользователя с колонкой. Home Assistant. Яндекс колонка. Диалог. Скрипт для взаимодействия пользователя с колонкой.
# Скрипт создан AlexOwl. Страница автора https://gist.github.com/AlexOwl
# Чтобы скрипт работал, обязательно создаем вспомогательный элемент "текст" и создаем с именем "yandex_station_dialog_tag"
alias: Яндекс колонка. Диалог
mode: single
variables:
yandex_station_entity: здесь указываем либо переменную последней активной колонки '{{ states.input_text.active_station.state }}' либо конкретную колонку media_player.yandex_station_00000000000000000000
dialog_tag_entity: input_text.yandex_station_dialog_tag
fields:
message:
@vvv279
vvv279 / low-battery-level-detection-notification-for-all-battery-sensors.yaml Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').