🍅 Умная Помидорка с Алисой: полный сценарий Pomodoro в Node-RED с управлением светом и остановкой по команде
Техника Pomodoro — простой и эффективный метод управления временем: 25 минут работы, 5 минут перерыва, 4 цикла. А что, если добавить к этому голосовое управление через Алису, плавное изменение освещения, которое помогает фокусироваться, и возможность остановить процесс в любой момент?
В этой статье: мы соберём полноценный сценарий «Умная Помидорка» в Node-RED с нуля — голосовое управление через Алису (запуск и остановка), таймеры, управление светом с эффектом «увядания», 4 цикла работы/перерыва и голосовые оповещения.
Содержание статьи
📋 Структура сценария
- Основной поток — таймеры, циклы, голосовые оповещения
- Подцикл увядания — плавное уменьшение яркости света каждую минуту
- Ветка остановки — прерывание помидорки по команде «стоп помидорка»
1. Подготовка Home Assistant
Шаг 1.1. Установите интеграцию Yandex Station Intents
- Откройте HACS → Интеграции
- Добавьте пользовательский репозиторий:
https://github.com/dext0r/ha-yandex-station-intents - Скачайте интеграцию → перезагрузите Home Assistant
Шаг 1.2. Добавьте в configuration.yaml
yandex_station_intents:
intents:
запусти помидорку:
say_phrase: "Запускаю продуктивный час"
extra_phrases:
- включи режим помидорки
- помидорка
- начать помидорку
стоп помидорка:
Шаг 1.3. Перезагрузите YAML
- Панель разработчика → YAML → Перезагрузить
2. Подготовка Node-RED
Шаг 2.1. Установите необходимые узлы
- Откройте Node-RED → Меню (☰) → Manage palette → вкладка Install
- Установите:
node-red-contrib-home-assistant-websocket(если ещё не установлен)
Шаг 2.2. Подключите Home Assistant
- Перетащите любой узел Home Assistant (например,
current state) на рабочую область - Дважды кликните → нажмите на значок карандаша ✏️ рядом с Server
- Укажите URL (например,
http://192.168.1.50:8123) и токен доступа (долгосрочный токен из профиля HA) - Нажмите Add → Done
3. Создание основного потока
🔹 Шаг 1. Узел «Слушаем Алису»
- Тип узла:
events: all(Home Assistant) - Событие:
yandex_intent
🔹 Шаг 2. Узел «Проверка команды Алиса»
- Тип узла:
switch - Свойство:
payload.event.text - Правила:
== запусти помидорку,== стоп помидорка
🔗 Выход 2 → Шаг 16 (Остановка помидорки)
🔹 Шаг 3. Узел «Сброс счетчика»
- Тип узла:
change - Правила:
Set flow.cycle_count = 0,Set flow.stop_fade = false,Set flow.paused = false
🔹 Шаг 4. Узел «Сброс force_stop»
- Тип узла:
change - Правило:
Set flow.force_stop = false
🔹 Шаг 5. Узел «Запуск помидорки»
- Тип узла:
function
flow.set("force_stop", false);
let currentCycle = flow.get("cycle_count") || 0;
flow.set("cycle_count", currentCycle + 1);
flow.set("stop_fade", false);
return msg;
🔹 Шаг 6. Узел «Включить свет 100%»
- Тип узла:
action(Home Assistant) - Domain:
light, Service:turn_on - Entity ID:
light.kolco2(замените на вашу лампу) - Data:
{ "brightness": 255, "color_name": "red" }
🔹 Шаг 7. Узел «Таймер работы 25 минут»
- Тип узла:
delay - Задержка: 30 секунд (для теста) → замените на 25 минут
🔹 Шаг 8. Узел «Конец работы»
- Тип узла:
function
if (flow.get("stop_fade") === true) {
return null;
}
flow.set("stop_fade", true);
return msg;
🔹 Шаг 9. Узел «Алиса - время закончилось»
- Тип узла:
action(Home Assistant) - Domain:
tts, Service:cloud_say - Data:
{"entity_id":"media_player.yandex_station","message":"25 минут прошло. Перерыв 5 минут!"}
🔹 Шаг 10. Узел «Восстановить свет 50%»
- Тип узла:
action(Home Assistant) - Domain:
light, Service:turn_on - Data:
{ "brightness": 127, "color_name": "purple" }
🔹 Шаг 11. Узел «Таймер перерыва 5 минут»
- Тип узла:
delay - Задержка: 15 секунд (для теста) → замените на 5 минут
🔹 Шаг 12. Узел «Конец перерыва»
- Тип узла:
function
if (flow.get("force_stop") === true) {
return null;
}
let currentCycle = flow.get("cycle_count") || 0;
if (currentCycle < 4) {
msg.payload = "true";
} else {
msg.payload = "false";
}
return msg;
🔹 Шаг 13. Узел «Проверка циклов»
- Тип узла:
switch - Свойство:
payload - Правила:
== true,== false
🔗 Выход 2 (false) → Шаг 20 (Алиса - финал)
🔹 Шаг 14. Узел «Алиса - новый цикл»
- Тип узла:
action(Home Assistant) - Domain:
tts, Service:cloud_say - Data:
{"entity_id":"media_player.yandex_station","message":"Перерыв закончен. Новый рабочий цикл"}
🔹 Шаг 15. Узел «Сброс force_stop» (для нового цикла)
- Тип узла:
change - Правило:
Set flow.force_stop = false
4. Ветка остановки
🔹 Шаг 16. Узел «Остановка помидорки»
- Тип узла:
change - Правила:
Set flow.stop_fade = true,Set flow.force_stop = true,Set flow.cycle_count = 0
🔹 Шаг 17. Узел «Отменить все таймеры»
- Тип узла:
function
flow.set("force_stop", true);
return msg;
🔗 → Шаг 19 (Выключить свет)
🔹 Шаг 18. Узел «Алиса - остановка»
- Тип узла:
action(Home Assistant) - Domain:
tts, Service:cloud_say - Data:
{"entity_id":"media_player.yandex_station","message":"Режим помидорки остановлен"}
🔹 Шаг 19. Узел «Выключить свет» (стоп)
- Тип узла:
action(Home Assistant) - Domain:
light, Service:turn_off - Entity ID:
light.kolco2
5. Завершение цикла
🔹 Шаг 20. Узел «Алиса - финал»
- Тип узла:
action(Home Assistant) - Domain:
tts, Service:cloud_say - Data:
{"entity_id":"media_player.yandex_station","message":"Поздравляю! 4 цикла помодоро завершены"}
🔹 Шаг 21. Узел «Выключить свет» (финал)
- Тип узла:
action(Home Assistant) - Domain:
light, Service:turn_off - Entity ID:
light.kolco2
6. Подцикл «Увядание света»
🔹 Шаг П1. Узел «Увядание каждую минуту»
- Тип узла:
inject - Repeat:
interval, Interval: 60 секунд
🔹 Шаг П2. Узел «Проверка stop_fade»
- Тип узла:
function
if (flow.get("stop_fade") === true) {
return null;
}
return msg;
🔹 Шаг П3. Узел «Состояние света»
- Тип узла:
current state(Home Assistant) - Entity ID:
light.kolco2
🔹 Шаг П4. Узел «Получить и уменьшить яркость»
- Тип узла:
function
if (msg.payload !== 'on') return null;
let brightness = msg.data.attributes.brightness || 255;
let newBrightness = brightness - 10;
if (newBrightness < 0) newBrightness = 0;
msg.payload = newBrightness;
return msg;
🔹 Шаг П5. Узел «Применить яркость»
- Тип узла:
action(Home Assistant) - Domain:
light, Service:turn_on - Data:
{"brightness":"{{payload}}", "color_name": "red"} - Data Type:
json
7. Импорт готового JSON
- Замените
light.kolco2на ID вашего светового устройства - Замените
media_player.yandex_stationна ID вашей колонки Алисы - Проверьте, что сервер Home Assistant в узлах настроен на ваш
- Убедитесь, что установлена библиотека
node-red-contrib-light-transition - Нажмите Deploy
[
{
"id": "f81cfe5921ca02c4",
"type": "tab",
"label": "Помидорка",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8f554989676f7bf6",
"type": "group",
"z": "f81cfe5921ca02c4",
"name": "Подцикл \"Увядание света\"",
"style": {
"fill": "#e3f3d3",
"label": true,
"color": "#000000",
"stroke": "#92d04f",
"label-position": "n"
},
"nodes": [
"4ed4c861ddef06aa",
"750fe30a1090a2ad",
"1e5f84f58e9303c8",
"2b3bf5da3f97f844",
"65df5bd8f0d1bce1"
],
"x": 194,
"y": 519,
"w": 1172,
"h": 82
},
{
"id": "6dd67855ce350629",
"type": "group",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Остановка",
"style": {
"stroke": "#ff0000",
"fill": "#ffbfbf",
"label": true,
"label-position": "ne",
"color": "#000000"
},
"nodes": [
"d3b44f4eedfd0455",
"ecb46edf2637ae94",
"23e9abffdae756f3",
"0778f0b4a863a8e4"
],
"x": 74,
"y": 179,
"w": 472,
"h": 222
},
{
"id": "ead4f69491b496d0",
"type": "group",
"z": "f81cfe5921ca02c4",
"name": "Основной цикл",
"style": {
"stroke": "#92d04f",
"fill": "#e3f3d3",
"label": true,
"label-position": "s",
"color": "#000000"
},
"nodes": [
"5fa8ce876fc27ad1",
"a1a9e258ae372360",
"78fd32de11902d3a",
"2c1110627cd1d26b",
"3b3ca2196b17a451",
"08946eeb32da5afd",
"7bf6e8803ee2c77d",
"38bae24ee21a108a",
"a3a38f249f26281b",
"a1680fa109093b65",
"e26c9b35b95f2f47",
"bbcd16bdcb20cb15",
"23ff47dcfc3d8c7e",
"34d4a416fa724924",
"b8b8fdfb656c2258",
"8114513a179d6960",
"74f278dba6824d5a",
"6dd67855ce350629"
],
"x": 34,
"y": 99,
"w": 1552,
"h": 390
},
{
"id": "4ed4c861ddef06aa",
"type": "inject",
"z": "f81cfe5921ca02c4",
"g": "8f554989676f7bf6",
"name": "Увядание каждую минуту",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 360,
"y": 560,
"wires": [
[
"65df5bd8f0d1bce1"
]
]
},
{
"id": "750fe30a1090a2ad",
"type": "api-current-state",
"z": "f81cfe5921ca02c4",
"g": "8f554989676f7bf6",
"name": "Состояние света",
"server": "2ced418881a9f77b",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.kolco2",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "string",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 730,
"y": 560,
"wires": [
[
"1e5f84f58e9303c8"
]
]
},
{
"id": "1e5f84f58e9303c8",
"type": "function",
"z": "f81cfe5921ca02c4",
"g": "8f554989676f7bf6",
"name": "Получить и уменьшить яркость",
"func": "if (msg.payload !== 'on') return null;\n\nlet brightness = msg.data.attributes.brightness || 255;\nlet newBrightness = brightness - 10;\nif (newBrightness < 0) newBrightness = 0;\n\n// Формируем команду — только яркость, цвет зададим в узле Применить яркость\nmsg.payload = newBrightness;\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 980,
"y": 560,
"wires": [
[
"2b3bf5da3f97f844"
]
]
},
{
"id": "2b3bf5da3f97f844",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "8f554989676f7bf6",
"name": "Применить яркость",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kolco2"
],
"labelId": [],
"data": "{\"brightness\":\"{{payload}}\", \"color_name\": \"red\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 1240,
"y": 560,
"wires": [
[]
]
},
{
"id": "65df5bd8f0d1bce1",
"type": "function",
"z": "f81cfe5921ca02c4",
"g": "8f554989676f7bf6",
"name": "Проверка stop_fade",
"func": "if (flow.get(\"stop_fade\") === true) {\n return null;\n}\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 600,
"y": 560,
"wires": [
[
"750fe30a1090a2ad"
]
]
},
{
"id": "5fa8ce876fc27ad1",
"type": "server-events",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Слушаем Алису",
"server": "2ced418881a9f77b",
"version": 3,
"exposeAsEntityConfig": "",
"eventType": "yandex_intent",
"eventData": "",
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"x": 140,
"y": 140,
"wires": [
[
"a1a9e258ae372360"
]
]
},
{
"id": "a1a9e258ae372360",
"type": "switch",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Проверка команды Алиса",
"property": "payload.event.text",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "запусти помидорку",
"vt": "str"
},
{
"t": "eq",
"v": "стоп помидорка",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 360,
"y": 140,
"wires": [
[
"78fd32de11902d3a"
],
[
"d3b44f4eedfd0455"
]
]
},
{
"id": "78fd32de11902d3a",
"type": "change",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Сброс счетчика",
"rules": [
{
"t": "set",
"p": "cycle_count",
"pt": "flow",
"to": "0",
"tot": "num"
},
{
"t": "set",
"p": "stop_fade",
"pt": "flow",
"to": "false",
"tot": "bool"
},
{
"t": "set",
"p": "paused",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 140,
"wires": [
[
"74f278dba6824d5a"
]
]
},
{
"id": "2c1110627cd1d26b",
"type": "function",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Запуск помидорки",
"func": "flow.set(\"force_stop\", false);\nlet currentCycle = flow.get(\"cycle_count\") || 0;\nnode.warn(\"ЗАПУСК: текущий cycle_count = \" + currentCycle);\nflow.set(\"cycle_count\", currentCycle + 1);\nnode.warn(\"ЗАПУСК: новый cycle_count = \" + (currentCycle + 1));\nflow.set(\"stop_fade\", false);\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 200,
"wires": [
[
"3b3ca2196b17a451"
]
]
},
{
"id": "3b3ca2196b17a451",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Включить свет 100%",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kolco2"
],
"labelId": [],
"data": "{ \"brightness\": 255, \"color_name\": \"red\" }",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 940,
"y": 200,
"wires": [
[
"b8b8fdfb656c2258"
]
]
},
{
"id": "08946eeb32da5afd",
"type": "function",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Конец работы",
"func": "if (flow.get(\"stop_fade\") === true) {\n return null;\n}\nflow.set(\"stop_fade\", true);\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1400,
"y": 200,
"wires": [
[
"38bae24ee21a108a"
]
]
},
{
"id": "7bf6e8803ee2c77d",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Восстановить свет 50%",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kolco2"
],
"labelId": [],
"data": "{ \"brightness\": 127, \"color_name\": \"purple\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 1010,
"y": 260,
"wires": [
[
"a3a38f249f26281b"
]
]
},
{
"id": "38bae24ee21a108a",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Алиса - время закончилось",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "tts.cloud_say",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\"entity_id\":\"media_player.yandex_station_lb0000000000004383030000c82146ae\",\"message\":\"25 минут прошло. Перерыв 5 минут!\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "tts",
"service": "cloud_say",
"x": 750,
"y": 260,
"wires": [
[
"7bf6e8803ee2c77d"
]
]
},
{
"id": "a3a38f249f26281b",
"type": "delay",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Таймер работы 5 минут",
"pauseType": "delay",
"timeout": "15",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1250,
"y": 260,
"wires": [
[
"34d4a416fa724924"
]
]
},
{
"id": "a1680fa109093b65",
"type": "switch",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Проверка циклов",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "true",
"vt": "str"
},
{
"t": "eq",
"v": "false",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 710,
"y": 360,
"wires": [
[
"e26c9b35b95f2f47"
],
[
"bbcd16bdcb20cb15"
]
]
},
{
"id": "e26c9b35b95f2f47",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Алиса - новый цикл",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "tts.cloud_say",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\"entity_id\":\"media_player.yandex_station_lb0000000000004383030000c82146ae\",\"message\":\"Перерыв закончен. Новый рабочий цикл\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "tts",
"service": "cloud_say",
"x": 1060,
"y": 360,
"wires": [
[
"8114513a179d6960"
]
]
},
{
"id": "bbcd16bdcb20cb15",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Алиса - финал",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "tts.cloud_say",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\"entity_id\":\"media_player.yandex_station_lb0000000000004383030000c82146ae\",\"message\":\"Поздравляю! 4 цикла помодоро завершены\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "tts",
"service": "cloud_say",
"x": 1040,
"y": 440,
"wires": [
[
"23ff47dcfc3d8c7e"
]
]
},
{
"id": "23ff47dcfc3d8c7e",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Выключить свет",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kolco2"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_off",
"x": 1270,
"y": 440,
"wires": [
[]
]
},
{
"id": "34d4a416fa724924",
"type": "function",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Конец перерыва",
"func": "// Проверка на принудительную остановку\nif (flow.get(\"force_stop\") === true) {\n return null;\n}\n\nlet currentCycle = flow.get(\"cycle_count\") || 0;\n\nif (currentCycle < 4) {\n msg.payload = \"true\";\n} else {\n msg.payload = \"false\";\n}\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1470,
"y": 260,
"wires": [
[
"a1680fa109093b65"
]
]
},
{
"id": "b8b8fdfb656c2258",
"type": "delay",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Таймер работы 25 минут",
"pauseType": "delay",
"timeout": "30",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1180,
"y": 200,
"wires": [
[
"08946eeb32da5afd"
]
]
},
{
"id": "d3b44f4eedfd0455",
"type": "change",
"z": "f81cfe5921ca02c4",
"g": "6dd67855ce350629",
"name": "Остановка помидорки",
"rules": [
{
"t": "set",
"p": "stop_fade",
"pt": "flow",
"to": "true",
"tot": "bool"
},
{
"t": "set",
"p": "force_stop",
"pt": "flow",
"to": "true",
"tot": "bool"
},
{
"t": "set",
"p": "cycle_count",
"pt": "flow",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 210,
"y": 220,
"wires": [
[
"ecb46edf2637ae94"
]
]
},
{
"id": "ecb46edf2637ae94",
"type": "function",
"z": "f81cfe5921ca02c4",
"g": "6dd67855ce350629",
"name": "Отменить все таймеры",
"func": "// Устанавливаем флаг принудительной остановки\nflow.set(\"force_stop\", true);\n\n// Отправляем пустые сообщения в таймеры, чтобы их прервать\n// Таймер работы (303aa7bfa02e3a70)\nnode.send([null, null, { reset: true }]);\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 210,
"y": 280,
"wires": [
[
"23e9abffdae756f3",
"0778f0b4a863a8e4"
]
]
},
{
"id": "23e9abffdae756f3",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "6dd67855ce350629",
"name": "Алиса - остановка",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "tts.cloud_say",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\"entity_id\":\"media_player.yandex_station_lb0000000000004383030000c82146ae\",\"message\":\"Режим помидорки остановлен\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "tts",
"service": "cloud_say",
"x": 210,
"y": 360,
"wires": [
[]
]
},
{
"id": "0778f0b4a863a8e4",
"type": "api-call-service",
"z": "f81cfe5921ca02c4",
"g": "6dd67855ce350629",
"name": "Выключить свет",
"server": "2ced418881a9f77b",
"version": 7,
"debugenabled": false,
"action": "light.turn_off",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.kolco2"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_off",
"x": 430,
"y": 360,
"wires": [
[]
]
},
{
"id": "8114513a179d6960",
"type": "change",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Сброс force_stop",
"rules": [
{
"t": "set",
"p": "force_stop",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1290,
"y": 360,
"wires": [
[
"2c1110627cd1d26b"
]
]
},
{
"id": "74f278dba6824d5a",
"type": "change",
"z": "f81cfe5921ca02c4",
"g": "ead4f69491b496d0",
"name": "Сброс force_stop",
"rules": [
{
"t": "set",
"p": "force_stop",
"pt": "flow",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 140,
"wires": [
[
"2c1110627cd1d26b"
]
]
},
{
"id": "2ced418881a9f77b",
"type": "server",
"name": "Home Assistant",
"version": 6,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": [
"y",
"yes",
"true",
"on",
"home",
"open"
],
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30,
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
},
{
"id": "5e23a57fd9081960",
"type": "global-config",
"env": [],
"modules": {
"node-red-contrib-home-assistant-websocket": "0.80.3"
}
}
]