О проекте
Сотрудничество
Партнеры
Скидки
Контакты
Submit
Фрагменты кода
Главная
Фрагменты кода
Бродкин Константин Владимирович
https://sprut.ai/client/pastes/dh4V7NfE
Шаблон шлюза Ebus-Modbus для контроллера WB6
// Configuration options { "device_type":"EBUS_MODBUS", "device":{ "name":"Ebus Modbus Boiler Controller", "id":"EBusModbus", "enabled": true, "channels": [ { "name": "Firmware", "type": "value", "reg_type": "input", "address": 999, "format": "u16", "scale": 0.01, "offset": 0 }, { "name": "Error", "type": "value", "reg_type": "input", "address": 1000, "format": "u16", "scale": 1, "offset": 0 }, { "name": "Temp boiler", "type": "value", "reg_type": "input", "address": 1001, "format": "u16", "scale": 1, "offset": 0 }, { "name": "Temp boiler setp", "type": "range", "reg_type": "holding_single", "address": 1002, "format": "u16", "scale": 1, "offset": 0, "max": 100, "round_to": 1 }, { "name": "Return water Temp", "type": "value", "reg_type": "input", "address": 1003, "format": "u16", "scale": 1, "offset": 0 }, { "name": "DHW temp", "type": "value", "reg_type": "input", "address": 1002, "format": "u16", "scale": 1, "offset": 0 }, { "name": "Temp DHWsetp", "type": "value", "reg_type": "input", "address": 1007, "format": "u16", "scale": 0.5, "offset": 0, "max": 100, "round_to": 1 }, { "name": "DHW setp", "type": "range", "reg_type": "holding_single", "address": 1003, "format": "u16", "scale": 1, "offset": 0, "max": 100, "round_to": 1 }, { "name": "Temp tank", "type": "value", "reg_type": "input", "address": 1004, "format": "u16", "scale": 1, "offset": 0 }, { "name": "Temp outside", "type": "value", "reg_type": "input", "address": 1005, "format": "u16", "scale": 0.1, "offset": -100 }, { "name": "Temp room", "type": "value", "reg_type": "input", "address": 1006, "format": "u16", "scale": 0.1, "offset": -100 }, { "name": "Temp room setp", "type": "range", "reg_type": "holding_single", "address": 1004, "format": "u16", "scale": 1, "offset": 0, "max": 30, "round_to": 1 }, { "name": "PWM duty", "type": "value", "reg_type": "input", "address": 1008, "format": "u16", "scale": 1, "offset": 0, "max": 100, "round_to": 1 } ] } }
Лузин Евгений Васильевич
https://sprut.ai/client/pastes/FF2CRjJr
Защита от дребезга контактов в Node-Red
[{"id":"89ea48a0.7cdf88","type":"tab","label":"Tests","disabled":false,"info":""},{"id":"8fb8d98b.35fe58","type":"delay","z":"89ea48a0.7cdf88","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":520,"y":440,"wires":[["cef46e22.582f8"]]},{"id":"cef46e22.582f8","type":"debug","z":"89ea48a0.7cdf88","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":810,"y":380,"wires":[]},{"id":"ae4edfde.5642e","type":"change","z":"89ea48a0.7cdf88","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":360,"wires":[["8fb8d98b.35fe58"]]},{"id":"88fb61d0.fac55","type":"inject","z":"89ea48a0.7cdf88","name":"1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":150,"y":360,"wires":[["11ddb46f.be547c"]]},{"id":"11ddb46f.be547c","type":"switch","z":"89ea48a0.7cdf88","name":"Open/Closed","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":380,"wires":[["ae4edfde.5642e","1a89d549.8fb4cb"],["8fb8d98b.35fe58","1df79fa0.04bd3"]]},{"id":"c8ef798d.529798","type":"inject","z":"89ea48a0.7cdf88","name":"0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":150,"y":400,"wires":[["11ddb46f.be547c"]]},{"id":"1a89d549.8fb4cb","type":"delay","z":"89ea48a0.7cdf88","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":520,"y":320,"wires":[["cef46e22.582f8"]]},{"id":"1df79fa0.04bd3","type":"change","z":"89ea48a0.7cdf88","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":400,"wires":[["1a89d549.8fb4cb"]]},{"id":"257b4290.41401e","type":"comment","z":"89ea48a0.7cdf88","name":"Защита от дребезга контактов","info":"","x":510,"y":40,"wires":[]},{"id":"81ed7da4.5559f","type":"comment","z":"89ea48a0.7cdf88","name":"Нода delay - время наличия устойчивого сигнала","info":"","x":530,"y":200,"wires":[]},{"id":"6964ab3c.ea9854","type":"comment","z":"89ea48a0.7cdf88","name":"Каждый сигнал задерживается на время в ноде Delay","info":"","x":510,"y":160,"wires":[]},{"id":"c215c81c.82b428","type":"comment","z":"89ea48a0.7cdf88","name":"Вход 1/0 Numeric","info":"","x":250,"y":280,"wires":[]},{"id":"b37e5106.63564","type":"comment","z":"89ea48a0.7cdf88","name":"Другой тип меняется в ноде switch","info":"","x":240,"y":320,"wires":[]},{"id":"e3e0fe91.c2d9c","type":"comment","z":"89ea48a0.7cdf88","name":"Обычно для защиты от дребезга милисекунды","info":"","x":540,"y":240,"wires":[]},{"id":"6d4e02f1.bd165c","type":"comment","z":"89ea48a0.7cdf88","name":"5 секунд - исключительно для теста","info":"","x":550,"y":280,"wires":[]},{"id":"48dd63bc.37185c","type":"comment","z":"89ea48a0.7cdf88","name":"Так же можно применять для игнорирования нестабильного состояния","info":"","x":540,"y":80,"wires":[]}]
Бурундуковский Игорь
https://sprut.ai/client/pastes/QsW6b3vJ
My Heat - описание API
ОГЛАВЛЕНИЕ Параметры запросов ...................................................................................................................... 1 Запрос списка контроллеров, подключенных к вашему аккаунту: .............................................. 1 Запрос состояния контроллера и его объектов: ............................................................................ 2 Установка целевого значения для среды (помещение, контур и т.д.): ........................................ 5 Установка погодозависимой кривой (ПЗА) для среды (контуры, смесительный узел): .............. 5 Установка режима работы инженерного оборудования: ............................................................ 5 Установка режима отопления или расписания: ............................................................................ 6 Снятие с охраны / постановка на охрану: ...................................................................................... 6 ПАРАМЕТРЫ ЗАПРОСОВ Запрос производится по URL: https://my2.myheat.net/api/request/ Метод: POST Запросы и ответы в формате JSON. В каждом запросе указывается действие (action), логин (login), ключ API (key). ЗАПРОС СПИСКА КОНТРОЛЛЕРОВ, ПОДКЛЮЧЕННЫХ К ВАШЕМУ АККАУНТУ : {"action":"getDevices","login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894"} Пример ответа: { "data":{ "devices":[ { "id":12, "name":"У Моста", "city":"Новошешминск", "severity":1, "severityDesc":"Система работает нормально." }, { "id":10, "name":"Хорошее место", "city":"Новошешминск", "severity":1, "severityDesc":"Система работает нормально." } ] }, "err":0, "refreshPage":false } Если запрос прошел без ошибок, то err будет равен 0. Поле severity - это критичность состояния (0 - неизвестно, 1 - норма, 32 - предупреждение, 64 - критическое). ЗАПРОС СОСТОЯНИЯ КОНТРОЛЛЕРА И ЕГО ОБЪЕКТОВ : {"action":"getDeviceInfo","deviceId":12,"login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894"} Пример ответа: { "data":{ "heaters":[ { "id":13, "name":"Vaillant правый", "disabled":false, "flowTemp":56, "returnTemp":56, "pressure":2.223, "targetTemp":0, "burnerHeating":false, "burnerWater":false, "modulation":0 }, { "id":37, "name":"Vaillant левый", "disabled":false, "flowTemp":56, "returnTemp":57, "pressure":2.436, "targetTemp":0, "burnerHeating":false, "burnerWater":false, "modulation":0 } ], "envs":[ { "id":21, "type":"boiler_temperature", "name":"Бойлер", "value":46.687, "target":45, "demand":false, "severity":1, "severityDesc":"Нормальное состояние." }, { "id":22, "type":"room_temperature", "name":"Кафе", "value":24.812, "target":23, "demand":false, "severity":1, "severityDesc":"Нормальное состояние." }, { "id":24, "type":"circuit_temperature", "name":"Контур отопления", "value":56, "target":null, "demand":false, "severity":1, "severityDesc":"Нормальное состояние." }, { "id":23, "type":"room_temperature", "name":"Магазин", "value":24.187, "target":23, "demand":false, "severity":1, "severityDesc":"Нормальное состояние." }, { "id":20, "type":"room_temperature", "name":"Бухгалтерия", "value":29.812, "target":null, "demand":false, "severity":1, "severityDesc":"Нормальное состояние." }, { "id":19, "type":"room_temperature", "name":"Котельная", "value":27.25, "target":null, "demand":false, "severity":1, "severityDesc":"Нормальное состояние." } ], "engs":[ { "id":40, "type":"pump", "name":"Насос магазин", "turnedOn":false, "severity":1, "severityDesc":"Насос работает исправно." }, { "id":41, "type":"pump", "name":"Насос бойлер", "turnedOn":false, "severity":1, "severityDesc":"Насос работает исправно." }, { "id":38, "type":"pump", "name":"Насос кафе", "turnedOn":false, "severity":1, "severityDesc":"Насос работает исправно." }, { "id":39, "type":"pump", "name":"Насос бухгалтерия", "turnedOn":false, "severity":1, "severityDesc":"Насос работает исправно." } ], "alarms":{ }, "dataActual":true, "severity":1, "severityDesc":"Система работает нормально.", "weatherTemp":"-6.78999999999996", "city":"Новошешминск" }, "err":0, "refreshPage":false } В ответе содержатся поля: - dataActual – true, если данные от контроллера актуальны (т.е. обновлены не позднее, чем 20 минут назад) - severity – общий статус системы (включая статусы всех объектов) - severityDesc – текстовое описание статуса - weatherTemp – уличная температура - city – название населенного пункта В ответе содержатся следующие массивы: - heaters – котлы - envs – среды (помещения, контуры отопления, смесительные контуры, бойлеры, контуры ГВС и т.д.) - engs – инженерное оборудование (насосы, клапаны, печи и т.д.0 - alarms – сигналы тревоги (протечки воды, пожарные, охранные, учетка газа и т.д.) Каждый объект содержит идентификатор, название, критичность состояния с расшифровкой и ряд дополнительных полей: 1. heaters a. disabled – признак того, что котел отключен в системе MY HEAT b. flowTemp – температура подачи котла c. returnTemp – температура обратки котла d. pressure – давление e. targetTemp – текущее целевое значение в контуре отопления (когда котел не горит, либо не запроса отопления от сред, может быть равно 0) f. burnerHeating – признак того, что горелка активна – котел греет систему отопления g. burnerWater– признак того, что горелка активна – котел греет ГВС h. modulation – модуляция горелки котла в % (степень открытия газового клапана) 2. envs a. value – текущее значение (температура) b. target – текущее целевое значение c. demand – признак того, что среда требует нагрева, т.е. дает запрос отопления котлу 3. engs a. turnedOn – признак того, что оборудование включено (открыто в случае клапана) 4. alarms a. alarm – признак того, что сигнал тревоги активен (т.е. в данный момент есть тревога) УСТАНОВКА ЦЕЛЕВОГО ЗНАЧЕНИЯ ДЛЯ СРЕДЫ (ПОМЕЩЕНИЕ, КОНТУР И Т.Д .): {"action":"setEnvGoal","login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894","deviceId":827,"objId":2,"goal":27} В тексте запроса указываются следующие параметры: 1. deviceId (обязательный) – идентификатора контроллера 2. objId (обязательный) – идентификатор среды 3. goal – целевое значение (если значение не указано, либо при указании значения, меньшего чем - 999, цель и погодозависимая кривая у среды сбрасывается). 4. changeMode – возможные значения: a. 0 – если в данный момент активен режим отопления, то режим будет сброшен. Система перейдет в состояние «Режим не выбран». b. значение не указано – аналогично значению «0». c. 1 – если в данный момент активен режим отопления, то в данный режим будут внесены соответствующие изменения (то есть – будет изменено целевое значение среды). Пример ответа: { "err":0, "refreshPage":false } Если запрос прошел без ошибок, то err будет равен 0. УСТАНОВКА ПОГОДОЗАВИСИМОЙ КРИВОЙ (ПЗА) ДЛЯ СРЕДЫ (КОНТУРЫ, СМЕСИТЕЛЬНЫЙ УЗЕЛ ): {"action":"setEnvCurve","login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894","deviceId":827,"objId":2,"curve":1} В тексте запроса указываются следующие параметры: 1. deviceId (обязательный) – идентификатора контроллера 2. objId (обязательный) – идентификатор среды 3. curve – идентификатор погодозависимой кривой (если значение не указано, либо при указании значения 0 и меньших значений, цель и погодозависимая кривая у среды сбрасывается) 4. changeMode – возможные значения: a. 0 – если в данный момент активен режим отопления, то режим будет сброшен. Система перейдет в состояние «Режим не выбран». b. значение не указано – аналогично значению «0». c. 1 – если в данный момент активен режим отопления, то в данный режим будут внесены соответствующие изменения (то есть – будет изменено целевое значение среды). Пример ответа: { "err":0, "refreshPage":false } Если запрос прошел без ошибок, то err будет равен 0. УСТАНОВКА РЕЖИМА РАБОТЫ ИНЖЕНЕРНОГО ОБОРУДОВАНИЯ: {"action":"setEngGoal","login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894","deviceId":827,"objId":2,"goal":0} В тексте запроса указываются следующие параметры: 1. deviceId (обязательный) – идентификатора контроллера 2. objId (обязательный) – идентификатор инженерного оборудования 3. goal – возможные значения: a. -1 (или любое отрицательное число) – автоматический режим b. 0 – принудительно выключено c. 1 – принудительно включено 4. changeMode – возможные значения: a. 0 – если в данный момент активен режим отопления, то режим будет сброшен. Система перейдет в состояние «Режим не выбран». b. значение не указано – аналогично значению «0». c. 1 – если в данный момент активен режим отопления, то в данный режим будут внесены соответствующие изменения (то есть – будет изменено целевое значение среды). Пример ответа: { "err":0, "refreshPage":false } Если запрос прошел без ошибок, то err будет равен 0. УСТАНОВКА РЕЖИМА ОТОПЛЕНИЯ ИЛИ РАСПИСАНИЯ : {"action":"setHeatingMode","login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894","deviceId":827,"modeId":2} В тексте запроса указываются следующие параметры: 1. deviceId (обязательный) – идентификатора контроллера 2. objId (обязательный) – идентификатор инженерного оборудования 3. modeId – идентификатор режима отопления 4. scheduleId – идентификатор расписания Должен быть задан один из параметров modeId, либо scheduleId. Значение параметра «0» означает сброс режима (например: “modeId”:0 или “scheduleId”:0). Пример ответа: { "err":0, "refreshPage":false } Если запрос прошел без ошибок, то err будет равен 0. СНЯТИЕ С ОХРАНЫ / ПОСТАНОВКА НА ОХРАНУ: {"action":"setSecurityMode","login":"lenino","key":"f11f45d5-5e3a827467cd14-02276894","deviceId":827,"mode":1} В тексте запроса указываются следующие параметры: 1. deviceId (обязательный) – идентификатора контроллера 2. objId (обязательный) – идентификатор инженерного оборудования 3. mode (обязательный) – возможные значения: a. 0 – снять с охраны b. 1 – поставить на охрану. Пример ответа: { "err":0, "refreshPage":false } Если запрос прошел без ошибок, то err будет равен 0.
Щинов Эдуард
https://sprut.ai/client/pastes/m47t3eVS
Управление освещением
{ "platform": "Modbus", "name": "Modbus", "ip": "192.168.1.71", "port": 502, "pollFrequency": 1000, "accessories": [ { "name": "Свет на кухне", "type": "Lightbulb", "On": "r8995" } ] }
Щинов Эдуард
https://sprut.ai/client/pastes/JSqyjE98
Управление климатом
{ "platform": "Modbus", "name": "Modbus", "ip": "192.168.1.71", "port": 502, "pollFrequency": 1000, "accessories": [ { "name": "Температура на балконе", "type": "TemperatureSensor", "CurrentTemperature": "r8988" }, { "name": "Температура в зале", "type": "Thermostat", "TargetTemperature": "r8989", "CurrentTemperature": "r8990" }, { "name": "Температура на кухне", "type": "Thermostat", "TargetTemperature": "r8991", "CurrentTemperature": "r8992" }, { "name": "Температура в спальне", "type": "Thermostat", "TargetTemperature": "r8993", "CurrentTemperature": "r8994" } ] }
Лузин Евгений Васильевич
https://sprut.ai/client/pastes/H3GKfWx6
3-х тарифный счетчик
[{"id":"829e7bba.7de188","type":"tab","label":"Потребление","disabled":false,"info":""},{"id":"491abdc8.209654","type":"debug","z":"829e7bba.7de188","name":"Холодильник","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":820,"y":480,"wires":[]},{"id":"2ae747c3.9ce188","type":"function","z":"829e7bba.7de188","name":"Телеграмм сутки","func":"if (msg.payload.send !== true){\n context.set(\"energy\", msg.payload);\n return;\n}\nvar characteristics = context.get(\"energy\");\nvar msg1 = \"?Ночь: \" + characteristics.night + \" руб.\\r\\n\";\nvar msg2 = \"☀️Пик: \"+ characteristics.pic +\" руб.\\r\\n\";\nvar msg3 = \"?Полупик: \"+ characteristics.semipic +\" руб.\\r\\n\";\nvar msg4 = \"?Общее сутки: \"+ characteristics.totalday +\" руб.\\r\\n\";\nvar msg5 = \"?Потребление за сутки\\r\\n\";\nvar msg6 = \"⏱️ \"+ characteristics.date + \"\\r\\n\";\nmsg.payload = msg6+msg1+msg2+msg3+msg4;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":380,"wires":[["a8aae397.05a5e","831c2170.bb051"]]},{"id":"a8aae397.05a5e","type":"link out","z":"829e7bba.7de188","name":"","links":["c99fd9d6.a13fd"],"x":855,"y":380,"wires":[]},{"id":"ede07880.fefd28","type":"comment","z":"829e7bba.7de188","name":"Сброс, msg.payload.reset = true","info":"","x":170,"y":340,"wires":[]},{"id":"ab2d7e88.38753","type":"comment","z":"829e7bba.7de188","name":"Подготовка для Телеграмм за сутки","info":"","x":590,"y":340,"wires":[]},{"id":"a6dbe7c0.86a928","type":"comment","z":"829e7bba.7de188","name":"На функцию Телеграмм","info":"","x":870,"y":340,"wires":[]},{"id":"f651d5f7.5842e8","type":"comment","z":"829e7bba.7de188","name":"Потребление в Кваттчас, msg.payload","info":"","x":170,"y":440,"wires":[]},{"id":"a3cafbe6.ddf858","type":"delay","z":"829e7bba.7de188","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":630,"y":480,"wires":[["491abdc8.209654"]]},{"id":"e3df8d6c.a533a","type":"comment","z":"829e7bba.7de188","name":"Ограничение отправки в \"debug\" так как у меня опрос 1 раз в 10 секунд","info":"","x":680,"y":440,"wires":[]},{"id":"d8dca131.bb127","type":"comment","z":"829e7bba.7de188","name":"Трех тарифный счетчик энергии","info":"","x":450,"y":40,"wires":[]},{"id":"831c2170.bb051","type":"change","z":"829e7bba.7de188","name":"Сброс","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"reset\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":130,"y":380,"wires":[["c78b3c4d.c4529"]]},{"id":"227beef4.540af2","type":"inject","z":"829e7bba.7de188","name":"Сброс ручной Сутки","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":300,"wires":[["831c2170.bb051"]]},{"id":"2504ff09.a1bb6","type":"comment","z":"829e7bba.7de188","name":"Сброс от инжекта","info":"","x":130,"y":220,"wires":[]},{"id":"df0e7db1.03d17","type":"change","z":"829e7bba.7de188","name":"Отправить","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"send\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":300,"wires":[["2ae747c3.9ce188"]]},{"id":"51e29d58.7ee314","type":"comment","z":"829e7bba.7de188","name":"Автоотправка в телеграмм","info":"","x":440,"y":240,"wires":[]},{"id":"aa5bd849.c4a3b8","type":"comment","z":"829e7bba.7de188","name":"Для начала использования необходимо сделать ручной сброс дважды","info":"","x":500,"y":120,"wires":[]},{"id":"957d24dd.f2bb38","type":"comment","z":"829e7bba.7de188","name":"contextStorage: { default: { module: \"localfilesystem\" } } раскомментировать!","info":"","x":510,"y":200,"wires":[]},{"id":"463c2cf2.ef6374","type":"comment","z":"829e7bba.7de188","name":"Для сохранения данных при рестарте Node-Red - в директории ~/ .node-red в файле settings.js","info":"","x":520,"y":160,"wires":[]},{"id":"f18fd045.abd3e","type":"inject","z":"829e7bba.7de188","name":"Отправить в 23:59","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"59 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":300,"wires":[["df0e7db1.03d17"]]},{"id":"ae9c6e06.72a21","type":"debug","z":"829e7bba.7de188","name":"Холодильник общее","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":840,"y":858,"wires":[]},{"id":"93823e95.91e3e","type":"function","z":"829e7bba.7de188","name":"Телеграмм общее","func":"if (msg.payload.send !== true){\n context.set(\"energy\", msg.payload);\n return;\n}\nvar characteristics = context.get(\"energy\");\nvar msg1 = \"?Ночь: \" + characteristics.night + \" руб.\\r\\n\";\nvar msg2 = \"☀️Пик: \"+ characteristics.pic +\" руб.\\r\\n\";\nvar msg3 = \"?Полупик: \"+ characteristics.semipic +\" руб.\\r\\n\";\nvar msg4 = \"?Общее: \"+ characteristics.totalday +\" руб.\\r\\n\";\nvar msg5 = \"?Потребление общее\\r\\n\";\nvar msg6 = \"⏱️ \"+ characteristics.date + \"\\r\\n\";\nmsg.payload = msg6+msg1+msg2+msg3+msg4;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":630,"y":760,"wires":[["2890e981.24e726"]]},{"id":"2890e981.24e726","type":"link out","z":"829e7bba.7de188","name":"","links":["c99fd9d6.a13fd"],"x":855,"y":758,"wires":[]},{"id":"2494bd3f.e7da92","type":"comment","z":"829e7bba.7de188","name":"Сброс, msg.payload.reset = true","info":"","x":170,"y":718,"wires":[]},{"id":"dc6ca3a0.f5758","type":"comment","z":"829e7bba.7de188","name":"Подготовка для Телеграмм общее","info":"","x":600,"y":720,"wires":[]},{"id":"68bb8521.1f145c","type":"comment","z":"829e7bba.7de188","name":"На функцию Телеграмм","info":"","x":870,"y":718,"wires":[]},{"id":"d69ca6c4.c117b8","type":"delay","z":"829e7bba.7de188","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":610,"y":858,"wires":[["ae9c6e06.72a21"]]},{"id":"12dc655a.e356cb","type":"comment","z":"829e7bba.7de188","name":"Ограничение отправки в \"debug\" так как у меня опрос 1 раз в 10 секунд","info":"","x":680,"y":818,"wires":[]},{"id":"aa8380dd.dbbf4","type":"change","z":"829e7bba.7de188","name":"Сброс","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"reset\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":130,"y":758,"wires":[["7e32f809.895bd8"]]},{"id":"2b745127.2c5cee","type":"inject","z":"829e7bba.7de188","name":"Сброс ручной Общий","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":678,"wires":[["aa8380dd.dbbf4"]]},{"id":"afdd505c.a5a55","type":"comment","z":"829e7bba.7de188","name":"Сброс от инжекта","info":"","x":130,"y":600,"wires":[]},{"id":"51b3c1aa.e3519","type":"change","z":"829e7bba.7de188","name":"Отправить","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"send\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":680,"wires":[["93823e95.91e3e"]]},{"id":"ddeba047.2cb18","type":"comment","z":"829e7bba.7de188","name":"Автоотправка в телеграмм","info":"","x":440,"y":618,"wires":[]},{"id":"a75aa256.5db0a","type":"inject","z":"829e7bba.7de188","name":"Отправить в 0:00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"01 07 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":390,"y":678,"wires":[["51b3c1aa.e3519"]]},{"id":"7e32f809.895bd8","type":"function","z":"829e7bba.7de188","name":"Потребление общее","func":"var characteristics = {};\nvar pic1 = context.get(\"pic1\");\nif (pic1 === undefined)\n{\n pic1 = msg.payload;\n context.set(\"pic1\", pic1);\n}\nvar pic2 = context.get(\"pic2\");\nif (pic2 === undefined)\n{\n pic2 = msg.payload;\n context.set(\"pic2\", pic2);\n}\nvar semipic1 = context.get(\"semipic1\");\nif (semipic1 === undefined)\n{\n semipic1 = msg.payload;\n context.set(\"semipic1\", semipic1);\n}\nvar semipic2 = context.get(\"semipic2\");\nif (semipic2 === undefined)\n{\n semipic2 = msg.payload;\n context.set(\"semipic2\", semipic2);\n}\nvar night = context.get(\"night\");\nif (night === undefined)\n{\n night = msg.payload;\n context.set(\"night\", night);\n}\nvar pic1old = context.get(\"pic1old\");\nif (pic1old === undefined)\n{\n pic1old = 0;\n context.set(\"pic1old\", pic1old);\n}\nvar pic2old = context.get(\"pic2old\");\nif (pic2old === undefined)\n{\n pic2old = 0;\n context.set(\"pic2old\", pic2old);\n}\nvar semipic1old = context.get(\"semipic1old\");\nif (semipic1old === undefined)\n{\n semipic1old = 0;\n context.set(\"semipic1old\", semipic1old);\n}\nvar semipic2old = context.get(\"semipic2old\");\nif (semipic2old === undefined)\n{\n semipic2old = 0;\n context.set(\"semipic2old\", semipic2old);\n}\nvar nightold = context.get(\"nightold\");\nif (nightold === undefined)\n{\n nightold = 0;\n context.set(\"nightold\", nightold);\n}\nvar pic1power;\nvar pic2power;\nvar nightpower;\nvar semipic1power;\nvar semipic2power;\nvar pic1dif = context.get(\"pic1dif\");\nif (pic1dif === undefined)\n{\n pic1dif = 0;\n context.set(\"pic1dif\", pic1dif);\n}\nvar pic2dif = context.get(\"pic2dif\");\nif (pic2dif === undefined)\n{\n pic2dif = 0;\n context.set(\"pic2dif\", pic2dif);\n}\nvar semipic1dif = context.get(\"semipic1dif\");\nif (semipic1dif === undefined)\n{\n semipic1dif = 0;\n context.set(\"semipic1dif\", semipic1dif);\n}\nvar semipic2dif = context.get(\"semipic2dif\");\nif (semipic2dif === undefined)\n{\n semipic2dif = 0;\n context.set(\"semipic2dif\", semipic2dif);\n}\nvar nightdif = context.get(\"nightdif\");\nif (nightdif === undefined)\n{\n nightdif = 0;\n context.set(\"nightdif\", nightdif);\n}\nvar date = new Date();\nvar hour = date.getHours();\n\n// Functions\nfunction between(x, min, max)\n{\n return x >= min && x < max;\n}\n//Russian date\nfunction datetime()\n{\nvar date = new Date();\nvar weekday = new Array(7);\nweekday[-1] = 'Вс';\nweekday[0] = 'Пн';\nweekday[1] = 'Вт';\nweekday[2] = 'Ср';\nweekday[3] = 'Чт';\nweekday[4] = 'Пт';\nweekday[5] = 'Сб';\n\nvar monthN = new Array(12);\nmonthN[0] = 'Января';\nmonthN[1] = 'Февраля';\nmonthN[2] = 'Марта';\nmonthN[3] = 'Апреля';\nmonthN[4] = 'Мая';\nmonthN[5] = 'Июня';\nmonthN[6] = 'Июля';\nmonthN[7] = 'Августа';\nmonthN[8] = 'Сентября';\nmonthN[9] = 'Октября';\nmonthN[10] = 'Ноября';\nmonthN[11] = 'Декабря';\n\n\nhour = date.getHours();\nminute = date.getMinutes();\nsecond = date.getSeconds();\n\nday = date.getDate();\nmonth = date.getMonth()+1;\nyear = date.getFullYear()-2000;\n\ndayName = weekday[date.getDay()-1];\nmonthName = monthN[date.getMonth()];\n\ndateString = dayName + ' ' +\n day.toString().padStart(2, '0') + ' ' + \n monthName;\n //month.toString().padStart(2, '0');\n //year.toString().padStart(2, '0');\n\ntimeString = hour.toString().padStart(2, '0') + ':' + \n minute.toString().padStart(2, '0');\n //second.toString().padStart(2, '0');\n \n\nreturn dateString + \" \" + timeString;\n}\n//Reset power\nif (msg.payload.reset !== true)\n{\n context.set(\"power\", msg.payload); \n}\nvar power = context.get(\"power\");\nif (power == undefined)\n{\n context.set(\"power\", 0);\n}\nif (msg.payload.reset === true)\n{\n context.set(\"pic1\", power);\n context.set(\"pic2\", power);\n context.set(\"semipic1\", power);\n context.set(\"semipic2\", power);\n context.set(\"night\", power);\n context.set(\"pic1old\", 0);\n context.set(\"pic2old\", 0);\n context.set(\"semipic1old\", 0);\n context.set(\"semipic2old\", 0);\n context.set(\"nightold\", 0);\n context.set(\"pic1dif\", 0);\n context.set(\"pic2dif\", 0);\n context.set(\"semipic1dif\", 0);\n context.set(\"semipic2dif\", 0);\n context.set(\"nightdif\", 0);\n}\n\n//Calculation\nif (hour >= 23 || hour < 7)\n{\n context.set(\"night\", power);\n context.set(\"nightdif\", (power - semipic2 + nightold));\n context.set(\"semipic2old\", semipic2dif);\n}\nif (between(hour, 7, 10))\n{\n context.set(\"pic1\", power);\n context.set(\"pic1dif\", (power - night + pic1old));\n context.set(\"nightold\", nightdif);\n}\nif (between(hour, 10, 17))\n{\n context.set(\"semipic1\", power);\n context.set(\"semipic1dif\", (power - pic1 + semipic1old));\n context.set(\"pic1old\", pic1dif);\n}\nif (between(hour, 17, 21))\n{\n context.set(\"pic2\", power);\n context.set(\"pic2dif\", (power - semipic1 + pic2old));\n context.set(\"semipic1old\", semipic1dif);\n}\nif (between(hour, 21, 23))\n{\n context.set(\"semipic2\", power);\n context.set(\"semipic2dif\", (power - pic2 + semipic2old));\n context.set(\"pic2old\", pic2dif);\n}\n\ncharacteristics.power = parseFloat(power.toFixed(3));\ncharacteristics.nightpower = parseFloat(nightdif.toFixed(3));\ncharacteristics.picpower = parseFloat((pic1dif + pic2dif).toFixed(3));\ncharacteristics.semipicpower = parseFloat((semipic1dif + semipic2dif).toFixed(3));\ncharacteristics.totaldaypower = parseFloat((characteristics.nightpower + characteristics.picpower + characteristics.semipicpower).toFixed(3));\ncharacteristics.night = parseFloat((characteristics.nightpower * 1.63).toFixed(2));\ncharacteristics.pic = parseFloat((characteristics.picpower * 5.84).toFixed(2));\ncharacteristics.semipic = parseFloat((characteristics.semipicpower * 4.67).toFixed(2));\ncharacteristics.totalday = parseFloat((characteristics.night + characteristics.pic + characteristics.semipic).toFixed(2));\ncharacteristics.date = datetime();\nmsg.payload = characteristics;\nnode.status({fill:\"blue\",shape:\"dot\",text: \"Потребление: \"+ power + \" КВтч \" + hour + \"ч.\"});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":758,"wires":[["93823e95.91e3e","d69ca6c4.c117b8","539113f1.0cbeec","e15db107.a024","79f4b753.d08598","d84ee681.f70a48","906c19ea.f733b8","4bc15ece.4ce61","2b6e5b3.34e7ba4","1f22aead.8b4021"]]},{"id":"d593961a.21ae38","type":"comment","z":"829e7bba.7de188","name":"Общий счетчик потребления, сброс в нужный период сделайте сами))","info":"","x":540,"y":558,"wires":[]},{"id":"539113f1.0cbeec","type":"function","z":"829e7bba.7de188","name":"Пик, рубли","func":"characteristics = {};\ncharacteristics = msg.payload.pic;\nmsg.topic = msg.lable = \"Пик\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":610,"y":980,"wires":[["ba98ce03.d8d79"]]},{"id":"310c536e.ec1ecc","type":"ui_chart","z":"829e7bba.7de188","name":"Рубли","group":"16e23caa.3695e3","order":1,"width":6,"height":6,"label":"Потребление, рублей","chartType":"bar","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff0000","#be38f3","#0000ff","#00ff00","#98df8a","#d62728","#ff9896","#996633","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":830,"y":1080,"wires":[[]]},{"id":"e15db107.a024","type":"function","z":"829e7bba.7de188","name":"ПолуПик, рубли","func":"characteristics = {};\ncharacteristics = msg.payload.semipic;\nmsg.topic = msg.lable = \"ПолуПик\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":1020,"wires":[["ba98ce03.d8d79"]]},{"id":"79f4b753.d08598","type":"function","z":"829e7bba.7de188","name":"Ночь, рубли","func":"characteristics = {};\ncharacteristics = msg.payload.night;\nmsg.topic = msg.lable = \"Ночь\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":610,"y":1060,"wires":[["ba98ce03.d8d79"]]},{"id":"d84ee681.f70a48","type":"function","z":"829e7bba.7de188","name":"Общее, рубли","func":"characteristics = {};\ncharacteristics = msg.payload.totalday;\nmsg.topic = msg.lable = \"Общий\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":1100,"wires":[["ba98ce03.d8d79"]]},{"id":"bd610239.f8a5","type":"comment","z":"829e7bba.7de188","name":" Потребление в Dusbotd за последние 6 дней","info":"","x":720,"y":940,"wires":[]},{"id":"906c19ea.f733b8","type":"function","z":"829e7bba.7de188","name":"Пик, Кватт*час","func":"characteristics = {};\ncharacteristics = msg.payload.picpower;\nmsg.topic = msg.lable = \"Пик\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":140,"y":980,"wires":[["4f3f2445.939bdc"]]},{"id":"4bc15ece.4ce61","type":"function","z":"829e7bba.7de188","name":"ПолуПик, Кватт*час","func":"characteristics = {};\ncharacteristics = msg.payload.semipicpower;\nmsg.topic = msg.lable = \"ПолуПик\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":160,"y":1020,"wires":[["4f3f2445.939bdc"]]},{"id":"2b6e5b3.34e7ba4","type":"function","z":"829e7bba.7de188","name":"Ночь, Кватт*час","func":"characteristics = {};\ncharacteristics = msg.payload.nightpower;\nmsg.topic = msg.lable = \"Ночь\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":140,"y":1060,"wires":[["4f3f2445.939bdc"]]},{"id":"1f22aead.8b4021","type":"function","z":"829e7bba.7de188","name":"Общее, Кватт*час","func":"characteristics = {};\ncharacteristics = msg.payload.totaldaypower;\nmsg.topic = msg.lable = \"Общий\";\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":150,"y":1100,"wires":[["4f3f2445.939bdc"]]},{"id":"6c879ae2.bb36c4","type":"ui_chart","z":"829e7bba.7de188","name":"Кватт*час","group":"16e23caa.3695e3","order":2,"width":6,"height":6,"label":"Потребление, Кватт*час","chartType":"bar","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff0000","#be38f3","#0000ff","#00ff00","#98df8a","#d62728","#ff9896","#996633","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":380,"y":1080,"wires":[[]]},{"id":"d7d6b149.0fa2e","type":"comment","z":"829e7bba.7de188","name":" Потребление в Dusbotd за последние 6 дней","info":"","x":240,"y":940,"wires":[]},{"id":"ba98ce03.d8d79","type":"bar-chart-data","z":"829e7bba.7de188","name":"bar-chart-data","x_interval":"days","x_size":"6","unit":"Кватт*час","precision":2,"is_meter_reading":"True","agg_by":"sum","x":819,"y":1020,"wires":[["310c536e.ec1ecc"]]},{"id":"4f3f2445.939bdc","type":"bar-chart-data","z":"829e7bba.7de188","name":"bar-chart-data","x_interval":"days","x_size":"6","unit":"Кватт*час","precision":2,"is_meter_reading":"True","agg_by":"sum","x":380,"y":1020,"wires":[["6c879ae2.bb36c4"]]},{"id":"c5920060.a58fc","type":"comment","z":"829e7bba.7de188","name":"Плагины: node-red-contrib-dashboard-bar-chart-data, node-red-dashboard","info":"","x":480,"y":80,"wires":[]},{"id":"c78b3c4d.c4529","type":"function","z":"829e7bba.7de188","name":"Потребление сутки","func":"var characteristics = {};\nvar pic1 = context.get(\"pic1\");\nif (pic1 == undefined)\n{\n pic1 = msg.payload;\n context.set(\"pic1\", pic1);\n}\nvar pic2 = context.get(\"pic2\");\nif (pic2 == undefined)\n{\n pic2 = msg.payload;\n context.set(\"pic2\", pic2);\n}\nvar semipic1 = context.get(\"semipic1\");\nif (semipic1 == undefined)\n{\n semipic1 = msg.payload;\n context.set(\"semipic1\", semipic1);\n}\nvar semipic2 = context.get(\"semipic2\");\nif (semipic2 == undefined)\n{\n semipic2 = msg.payload;\n context.set(\"semipic2\", semipic2);\n}\nvar night = context.get(\"night\");\nif (night == undefined)\n{\n night = msg.payload;\n context.set(\"night\", night);\n}\nvar pic1old = context.get(\"pic1old\");\nif (pic1old == undefined)\n{\n pic1old = 0;\n context.set(\"pic1old\", pic1old);\n}\nvar pic2old = context.get(\"pic2old\");\nif (pic2old == undefined)\n{\n pic2old = 0;\n context.set(\"pic2old\", pic2old);\n}\nvar semipic1old = context.get(\"semipic1old\");\nif (semipic1old == undefined)\n{\n semipic1old = 0;\n context.set(\"semipic1old\", semipic1old);\n}\nvar semipic2old = context.get(\"semipic2old\");\nif (semipic2old == undefined)\n{\n semipic2old = 0;\n context.set(\"semipic2old\", semipic2old);\n}\nvar nightold = context.get(\"nightold\");\nif (nightold == undefined)\n{\n nightold = 0;\n context.set(\"nightold\", nightold);\n}\nvar pic1power;\nvar pic2power;\nvar nightpower;\nvar semipic1power;\nvar semipic2power;\nvar pic1dif = context.get(\"pic1dif\");\nif (pic1dif === undefined)\n{\n pic1dif = 0;\n context.set(\"pic1dif\", pic1dif);\n}\nvar pic2dif = context.get(\"pic2dif\");\nif (pic2dif == undefined)\n{\n pic2dif = 0;\n context.set(\"pic2dif\", pic2dif);\n}\nvar semipic1dif = context.get(\"semipic1dif\");\nif (semipic1dif == undefined || semipic1dif == null)\n{\n semipic1dif = 0;\n context.set(\"semipic1dif\", semipic1dif);\n}\nvar semipic2dif = context.get(\"semipic2dif\");\nif (semipic2dif == undefined)\n{\n semipic2dif = 0;\n context.set(\"semipic2dif\", semipic2dif);\n}\nvar nightdif = context.get(\"nightdif\");\nif (nightdif == undefined)\n{\n nightdif = 0;\n context.set(\"nightdif\", nightdif);\n}\nvar date = new Date();\nvar hour = date.getHours();\n\n// Functions\nfunction between(x, min, max)\n{\n return x >= min && x < max;\n}\n//Russian date\nfunction datetime()\n{\nvar date = new Date();\nvar weekday = new Array(7);\nweekday[-1] = 'Вс';\nweekday[0] = 'Пн';\nweekday[1] = 'Вт';\nweekday[2] = 'Ср';\nweekday[3] = 'Чт';\nweekday[4] = 'Пт';\nweekday[5] = 'Сб';\n\nvar monthN = new Array(12);\nmonthN[0] = 'Января';\nmonthN[1] = 'Февраля';\nmonthN[2] = 'Марта';\nmonthN[3] = 'Апреля';\nmonthN[4] = 'Мая';\nmonthN[5] = 'Июня';\nmonthN[6] = 'Июля';\nmonthN[7] = 'Августа';\nmonthN[8] = 'Сентября';\nmonthN[9] = 'Октября';\nmonthN[10] = 'Ноября';\nmonthN[11] = 'Декабря';\n\n\nhour = date.getHours();\nminute = date.getMinutes();\nsecond = date.getSeconds();\n\nday = date.getDate();\nmonth = date.getMonth()+1;\nyear = date.getFullYear()-2000;\n\ndayName = weekday[date.getDay()-1];\nmonthName = monthN[date.getMonth()];\n\ndateString = dayName + ' ' +\n day.toString().padStart(2, '0') + ' ' + \n monthName;\n //month.toString().padStart(2, '0');\n //year.toString().padStart(2, '0');\n\ntimeString = hour.toString().padStart(2, '0') + ':' + \n minute.toString().padStart(2, '0');\n //second.toString().padStart(2, '0');\n \n\nreturn dateString + \" \" + timeString;\n}\n//Reset power\nif (msg.payload.reset !== true)\n{\n context.set(\"power\", msg.payload); \n}\nvar power = context.get(\"power\");\nif (power == undefined)\n{\n context.set(\"power\", 0);\n}\nif (msg.payload.reset === true)\n{\n context.set(\"pic1\", power);\n context.set(\"pic2\", power);\n context.set(\"semipic1\", power);\n context.set(\"semipic2\", power);\n context.set(\"night\", power);\n context.set(\"pic1old\", 0);\n context.set(\"pic2old\", 0);\n context.set(\"semipic1old\", 0);\n context.set(\"semipic2old\", 0);\n context.set(\"nightold\", 0);\n context.set(\"pic1dif\", 0);\n context.set(\"pic2dif\", 0);\n context.set(\"semipic1dif\", 0);\n context.set(\"semipic2dif\", 0);\n context.set(\"nightdif\", 0);\n}\n\n//Calculation\n// Интервал ночь 23 - 7\nif (hour >= 23 || hour < 7)\n{\n context.set(\"night\", power);\n context.set(\"nightdif\", (power - semipic2 + nightold));\n context.set(\"semipic2old\", semipic2dif);\n}\n//Интервал 7 - 10 Пик\nif (between(hour, 7, 10))\n{\n context.set(\"pic1\", power);\n context.set(\"pic1dif\", (power - night + pic1old));\n context.set(\"nightold\", nightdif);\n}\n//Интервал 10 - 17 ПолуПик\nif (between(hour, 10, 17))\n{\n context.set(\"semipic1\", power);\n context.set(\"semipic1dif\", (power - pic1 + semipic1old));\n context.set(\"pic1old\", pic1dif);\n}\n//Интервал 17 - 21 Пик\nif (between(hour, 17, 21))\n{\n context.set(\"pic2\", power);\n context.set(\"pic2dif\", (power - semipic1 + pic2old));\n context.set(\"semipic1old\", semipic1dif);\n}\n//Интервал 21 - 23 ПолуПик\nif (between(hour, 21, 23))\n{\n context.set(\"semipic2\", power);\n context.set(\"semipic2dif\", (power - pic2 + semipic2old));\n context.set(\"pic2old\", pic2dif);\n}\n\ncharacteristics.power = parseFloat(power.toFixed(3));\ncharacteristics.nightpower = parseFloat(nightdif.toFixed(3));\ncharacteristics.picpower = parseFloat((pic1dif + pic2dif).toFixed(3));\ncharacteristics.semipicpower = parseFloat((semipic1dif + semipic2dif).toFixed(3));\ncharacteristics.totaldaypower = parseFloat((characteristics.nightpower + characteristics.picpower + characteristics.semipicpower).toFixed(3));\n//Стоимость по тарифам: 1.63 Ночь, 5.84 Пик, 4.67 Полупик\ncharacteristics.night = parseFloat((characteristics.nightpower * 1.63).toFixed(2));\ncharacteristics.pic = parseFloat((characteristics.picpower * 5.84).toFixed(2));\ncharacteristics.semipic = parseFloat((characteristics.semipicpower * 4.67).toFixed(2));\ncharacteristics.totalday = parseFloat((characteristics.night + characteristics.pic + characteristics.semipic).toFixed(2));\ncharacteristics.date = datetime();\nmsg.payload = characteristics;\nnode.status({fill:\"blue\",shape:\"dot\",text: \"Потребление: \"+ power + \" КВтч \" + hour + \"ч.\"});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":340,"y":380,"wires":[["2ae747c3.9ce188","a3cafbe6.ddf858"]]},{"id":"1961552b.97d71b","type":"link in","z":"829e7bba.7de188","name":"","links":["ab2e0b32.243358"],"x":135,"y":500,"wires":[["c78b3c4d.c4529","7e32f809.895bd8"]]},{"id":"c6dbeb60.c06158","type":"comment","z":"829e7bba.7de188","name":"Самый первый раз дважды","info":"","x":160,"y":260,"wires":[]},{"id":"7974123d.ba093c","type":"comment","z":"829e7bba.7de188","name":"Самый первый раз дважды","info":"","x":140,"y":640,"wires":[]},{"id":"16e23caa.3695e3","type":"ui_group","name":"Потребление2","tab":"c93c850d.f69248","order":1,"disp":true,"width":"6","collapse":false},{"id":"c93c850d.f69248","type":"ui_tab","name":"Потребление2","icon":"dashboard","order":13,"disabled":false,"hidden":false}]
Лузин Евгений Васильевич
https://sprut.ai/client/pastes/CaSP9zKy
Датчик присутствия
[{"id":"d2007c18.55d7d","type":"tab","label":"Туалет","disabled":false,"info":""},{"id":"d96aaf5.0a9b65","type":"comment","z":"d2007c18.55d7d","name":"Состояние света в global","info":"","x":250,"y":80,"wires":[]},{"id":"e9d5b1c8.356d","type":"spruthub-in","z":"d2007c18.55d7d","name":"","server":"","friendly_name":"Ванная Свет","uid":[],"cid":"","showHidden":false,"enableMultiple":false,"outputAtStartup":true,"x":130,"y":140,"wires":[["5ea15cf9.c776c4"]]},{"id":"5ea15cf9.c776c4","type":"function","z":"d2007c18.55d7d","name":"Свет","func":"global.set(\"Ванна_Свет\", msg.payload.On);\nif (msg.payload.On === true)\n{\n node.status({fill:\"green\",shape:\"dot\",text: \"Включен\"}); \n}\nelse if (msg.payload.On === false)\n{\n node.status({fill:\"red\",shape:\"dot\",text: \"Выключен\"}); \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":140,"wires":[[]]},{"id":"7d7cc04b.56feb","type":"comment","z":"d2007c18.55d7d","name":"Дверь открыта/закрыта в global","info":"","x":250,"y":200,"wires":[]},{"id":"35965d03.ca0f52","type":"spruthub-in","z":"d2007c18.55d7d","name":"Ванная Дверь","server":"","friendly_name":"Ванная Дверь","uid":[],"cid":"","showHidden":false,"enableMultiple":false,"outputAtStartup":true,"x":140,"y":260,"wires":[["d9c74035.7ce74"]]},{"id":"d9c74035.7ce74","type":"function","z":"d2007c18.55d7d","name":"Дверь","func":"global.set(\"Ванна_Дверь\", msg.payload.ContactSensorState);\nif (msg.payload.ContactSensorState === 1)\n{\n node.status({fill:\"green\",shape:\"dot\",text: \"Открыта\"}); \n}\nelse if (msg.payload.ContactSensorState === 0)\n{\n node.status({fill:\"red\",shape:\"dot\",text: \"Закрыта\"}); \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":260,"wires":[[]]},{"id":"65093df2.2afbb4","type":"function","z":"d2007c18.55d7d","name":"Движение","func":"var characteristics = {};\nglobal.set(\"Ванна_Движение\", msg.payload.MotionDetected);\nif (msg.payload.MotionDetected === true)\n{\n node.status({fill:\"green\",shape:\"dot\",text: \"Движение\"}); \n}\nelse if (msg.payload.MotionDetected === false)\n{\n node.status({fill:\"red\",shape:\"dot\",text: \"Нет движения\"}); \n}\ncharacteristics.On = msg.payload.MotionDetected;\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":380,"wires":[["61ac189e.13e7b8"]]},{"id":"12cc9cd0.abe093","type":"spruthub-in","z":"d2007c18.55d7d","name":"","server":"","friendly_name":"Ванная Движение","uid":[],"cid":"","showHidden":false,"enableMultiple":false,"outputAtStartup":true,"x":150,"y":380,"wires":[["65093df2.2afbb4"]]},{"id":"28e9df72.c62b1","type":"comment","z":"d2007c18.55d7d","name":"Движение в global","info":"","x":270,"y":320,"wires":[]},{"id":"64658ae9.abab14","type":"comment","z":"d2007c18.55d7d","name":"Кто-то зашел","info":"","x":770,"y":460,"wires":[]},{"id":"f831a9cb.381ec8","type":"change","z":"d2007c18.55d7d","name":"Кто-то внутри","rules":[{"t":"set","p":"Внутри","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":500,"wires":[["8f4d0e58.b59e7"]]},{"id":"8e00cdc2.41c9d","type":"spruthub-in","z":"d2007c18.55d7d","name":"Ванная Дверь","server":"","friendly_name":"Ванная Дверь","uid":[],"cid":"","showHidden":false,"enableMultiple":false,"outputAtStartup":true,"x":140,"y":500,"wires":[["b5ed3b0b.dfa4e8"]]},{"id":"b5ed3b0b.dfa4e8","type":"switch","z":"d2007c18.55d7d","name":"Дверь З/О?","property":"payload.ContactSensorState","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":130,"y":600,"wires":[["ea9312ec.31ffc","ca15b068.5d043","5e444f59.3bf6b"],["729971fe.c0aff"]]},{"id":"ea9312ec.31ffc","type":"switch","z":"d2007c18.55d7d","name":"Если движение?","property":"Ванна_Движение","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":500,"wires":[["f831a9cb.381ec8"]]},{"id":"78f177a6.0ffb28","type":"comment","z":"d2007c18.55d7d","name":"Кто-то вышел","info":"","x":770,"y":540,"wires":[]},{"id":"ca15b068.5d043","type":"switch","z":"d2007c18.55d7d","name":"Кто-то внутри?","property":"Внутри","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":580,"wires":[["525f96ea.752018"]]},{"id":"525f96ea.752018","type":"change","z":"d2007c18.55d7d","name":"Никого нет","rules":[{"t":"set","p":"Внутри","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":580,"wires":[["8f4d0e58.b59e7"]]},{"id":"8f4d0e58.b59e7","type":"function","z":"d2007c18.55d7d","name":"Внутри","func":"var characteristics = {};\nif (global.get(\"Внутри\") === true)\n{\n characteristics.OccupancyDetected = true;\n node.status({fill:\"green\",shape:\"dot\",text: \"Кто-то Внутри\"}); \n}\nelse if (global.get(\"Внутри\") === false)\n{\n characteristics.OccupancyDetected = false;\n node.status({fill:\"red\",shape:\"dot\",text: \"Никого нет\"}); \n}\nmsg.payload = characteristics;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":980,"y":580,"wires":[["e05b3044.318ec"]]},{"id":"634a8637.488c88","type":"comment","z":"d2007c18.55d7d","name":"Статус если кто-то внутри в global","info":"","x":280,"y":440,"wires":[]},{"id":"e590ef93.9c17f","type":"switch","z":"d2007c18.55d7d","name":"Никого","property":"Внутри","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":1000,"wires":[["2a03e88a.e0f738"]]},{"id":"889118b.1c4a5e8","type":"spruthub-out","z":"d2007c18.55d7d","name":"","server":"","friendly_name":"Ванная Свет","uid":[],"cid":"","showHidden":false,"enableMultiple":false,"payload":"payload","payloadType":"msg","x":970,"y":1000,"wires":[]},{"id":"2a03e88a.e0f738","type":"change","z":"d2007c18.55d7d","name":"Включить","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.On","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":1000,"wires":[["889118b.1c4a5e8"]]},{"id":"f22b7538.b77468","type":"switch","z":"d2007c18.55d7d","name":"Никого","property":"Внутри","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":860,"wires":[["e7a3edb7.3314f"]]},{"id":"e7a3edb7.3314f","type":"change","z":"d2007c18.55d7d","name":"Выключить","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.On","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":940,"wires":[["889118b.1c4a5e8"]]},{"id":"e25b9144.07af7","type":"delay","z":"d2007c18.55d7d","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":410,"y":860,"wires":[["f22b7538.b77468"]]},{"id":"5e444f59.3bf6b","type":"change","z":"d2007c18.55d7d","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":700,"wires":[["e5bb98f8.c16d38"]]},{"id":"b65c0226.7de88","type":"trigger","z":"d2007c18.55d7d","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":610,"y":940,"wires":[["e7a3edb7.3314f"]]},{"id":"e05b3044.318ec","type":"homekit-service","z":"d2007c18.55d7d","isParent":true,"bridge":"","parentService":"","name":"Ванная Присутствие","serviceName":"OccupancySensor","topic":"","filter":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":2,"x":1020,"y":500,"wires":[[],[]]},{"id":"e5bb98f8.c16d38","type":"trigger","z":"d2007c18.55d7d","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":610,"y":640,"wires":[["525f96ea.752018"]]},{"id":"729971fe.c0aff","type":"switch","z":"d2007c18.55d7d","name":"Кто-то внутри?","property":"Внутри","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":640,"wires":[["e5bb98f8.c16d38"]]},{"id":"60ad2fd1.1e323","type":"spruthub-in","z":"d2007c18.55d7d","name":"Ванная Дверь","server":"","friendly_name":"Ванная Дверь","uid":[],"cid":"","showHidden":false,"enableMultiple":false,"outputAtStartup":true,"x":140,"y":880,"wires":[["66121f6f.da5f"]]},{"id":"66121f6f.da5f","type":"switch","z":"d2007c18.55d7d","name":"Дверь З/О?","property":"payload.ContactSensorState","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":130,"y":960,"wires":[["e25b9144.07af7","61ac189e.13e7b8"],["e590ef93.9c17f","b65c0226.7de88"]]},{"id":"61ac189e.13e7b8","type":"change","z":"d2007c18.55d7d","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":920,"wires":[["b65c0226.7de88"]]},{"id":"7df7821b.7a628c","type":"comment","z":"d2007c18.55d7d","name":"Управление светом по датчику присутствия","info":"","x":550,"y":800,"wires":[]},{"id":"5d1a06d0.dbd0f8","type":"comment","z":"d2007c18.55d7d","name":"Датчик присутствия","info":"","x":990,"y":460,"wires":[]},{"id":"65aa740f.4f197c","type":"comment","z":"d2007c18.55d7d","name":"Датчик отдает движение 10 секунд","info":"","x":540,"y":320,"wires":[]},{"id":"d6ed7217.80a43","type":"comment","z":"d2007c18.55d7d","name":"Send value on start - должно быть активно","info":"","x":670,"y":80,"wires":[]},{"id":"21a2f695.6da0ba","type":"inject","z":"d2007c18.55d7d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":140,"wires":[["7655e613.9df9d8"]]},{"id":"7655e613.9df9d8","type":"change","z":"d2007c18.55d7d","name":"Никого нет","rules":[{"t":"set","p":"Внутри","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":140,"wires":[[]]}]
Захаревский Эдуард Вячеславович
https://sprut.ai/client/pastes/Pxu6mDVy
Отправка данных из Home Assistant на сервис APRS - aprs_sender/aprs_sender.py
import appdaemon.plugins.hass.hassapi as hass import sys, time, datetime import collections # from socket import * import socket serverHost = 'euro.aprs2.net' serverPort = 14580 password = 'XXXX' address = 'YYYYY>APRS,TCPIP*:' position = '=ddmm.hhN/0ddmm.hhE-' # comment length is supposed to be 0 to 43 char. comment = 'Python Script for Home Assistant' packet = '' delay = 60*30 # delay in seconds - 1800 sec (30 min). is for testing- should be 20 to 30 min for fixed QTH def send_packet(): # create socket & connect to server # sock = socket(AF_INET, SOCK_STREAM) sock = socket.socket() sock.connect((serverHost, serverPort)) # logon sock.send(('user YYYYY pass ' + password + ' vers "YYYYY Python" \n').encode()) # send packet sock.send((address + position + comment +'\n').encode()) # print("packet sent: " + time.ctime() ) # close socket -- must be closed to avoidbuffer overflow time.sleep(15) # 15 sec. delay sock.shutdown(0) sock.close() packet = address + position + comment # print (packet) # prints the packet being sent # print (len(comment)) # prints the length of the comment part of the packet while 1: send_packet() time.sleep(delay)
Захаревский Эдуард Вячеславович
https://sprut.ai/client/pastes/fZe3nKNw
Отправка данных из Home Assistant на сервис APRS - aprs_sender/aprs_sender.yaml
aprs_sender: module: aprs_sender class: aprs_sender
Лузин Евгений Васильевич
https://sprut.ai/client/pastes/q6Z5E4HJ
Азы Node-Red: HomeKit 2
[{"id":"8982eb22.ca1e08","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"8f8a3ab9.f3fd68","type":"mqtt in","z":"8982eb22.ca1e08","name":"","topic":"stat/tasmota-socket-01/POWER","qos":"2","datatype":"utf8","broker":"2d17cec1.5fb732","x":230,"y":180,"wires":[["ddf975e3.bc1a68"]]},{"id":"acb42955.cd43a8","type":"mqtt out","z":"8982eb22.ca1e08","name":"","topic":"cmnd/tasmota-socket-01/power","qos":"2","retain":"true","broker":"2d17cec1.5fb732","x":890,"y":220,"wires":[]},{"id":"bfac7565.dd5f18","type":"homekit-service","z":"8982eb22.ca1e08","isParent":true,"bridge":"2c337ed8.8f6492","parentService":"","name":"Tuya Plug Test","serviceName":"Outlet","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","x":580,"y":280,"wires":[["918135e8.1687b8"],[]]},{"id":"ddf975e3.bc1a68","type":"function","z":"8982eb22.ca1e08","name":"ToKitConversion","func":"var characteristic = {};\nif (msg.payload === \"ON\")\n{\n characteristic.On = true;\n}\nelse if (msg.payload === \"OFF\")\n{\n characteristic.On = false;\n}\ncharacteristic.OutletInUse = characteristic.On;\nmsg.payload = characteristic;\nnode.status({fill:\"green\",shape:\"ring\",\"text\": \"On: \"+msg.payload.On});\nreturn msg;","outputs":1,"noerr":0,"x":460,"y":80,"wires":[["bfac7565.dd5f18"]]},{"id":"918135e8.1687b8","type":"function","z":"8982eb22.ca1e08","name":"FromKitConversion","func":"var characteristic = {};\nif (msg.payload.On === true)\n{\n characteristic = \"on\"; \n}\nif (msg.payload.On === false)\n{\n characteristic = \"off\"; \n}\nnode.status({fill:\"green\",shape:\"ring\",\"text\": \"On: \"+msg.payload.On});\nmsg.payload = characteristic;\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":80,"wires":[["acb42955.cd43a8"]]},{"id":"6166238.0766cdc","type":"inject","z":"8982eb22.ca1e08","name":"","topic":"","payload":"{\"foo\":\"bar\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":280,"wires":[["bfac7565.dd5f18"]]},{"id":"2d17cec1.5fb732","type":"mqtt-broker","z":"","name":"local","broker":"localhost","port":"1883","clientid":"NodeRed","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"2","birthRetain":"true","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"2c337ed8.8f6492","type":"homekit-bridge","z":"","bridgeName":"Plugs","pinCode":"333-33-332","port":"","allowInsecureRequest":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":false}]
Попов Андрей
https://sprut.ai/client/pastes/JYwu9hKc
Режим киоска на Raspberry PI
#!/bin/bash xset s noblank xset s off xset -dpms xset s 0 0 xset s noblank xset s noexpose xset dpms 0 0 0 unclutter -idle 0.1 -keystroke -root & sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences chromium-browser http://127.0.0.1:1880/ui --window-size=1920,1080 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disabl$ while true; do xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab; sleep 15 xdone
Никольский Виталий Борисович
https://sprut.ai/client/pastes/tusGUWy4
Форматирование температуры для Алисы
var home_temp = Math.round(global.get('weather.home.temp')); var street_temp = Math.round(global.get('weather.street_temp')); var wind = Math.round(global.get('weather.wind')); var cloud = global.get('weather.cloud'); var word = {}; var temp = {}; var btemp = {}; var a = street_temp+""; var b = home_temp+""; var speriod = {}; var bperiod = {}; var c = {}; if ((street_temp >= 20) || (street_temp <= 10)) {speriod = true} else {speriod = false} if ((home_temp >= 20) || (home_temp <= 10)) {bperiod = true} else {bperiod = false} a = parseInt(a.substring(a.length-1)); b = parseInt(b.substring(b.length-1)); if ((a == 1) && (speriod === true)) {temp = "градус";} else if (((a >=2) && (a <= 4)) && (speriod === true)) {temp = "градуса";} else if ((a > 4) && (speriod === true)) {temp = "градусов";} else {temp = "градусов";} if ((b == 1) && (bperiod === true)) {btemp = "градус";} else if ((b >=2) && (b <= 4) && (bperiod === true)) {btemp = "градуса";} else if ((b > 4) && (speriod === true)) {btemp = "градусов";} else {btemp = "градусов";} if (wind == 1) {word = "метр";} else if ((wind >=2) && (wind <= 4)) {word = "метра";} else if (wind > 4) {word = "метров";} msg.payload = ("Снаружи " + street_temp + " " + temp + ", скорость ветра, " + wind + " " + word + " в секунду, " +cloud+ ", дома " + home_temp + " " + btemp +"."); return msg;
Громов Роман
https://sprut.ai/client/pastes/2QwkxPpR
Ventmachine ui-lovelace.yaml
- entity: sensor.satellite_current_temp type: custom:multiple-entity-row name: Вентиляция icon: mdi:air-filter state_header: Текущая secondary_info: entity: binary_sensor.satellite_ping name: false entities: - entity: sensor.satellite_current_fs name: скорость - entity: input_number.satellite_target_temp name: задана unit: °С ############### cards: - type: vertical-stack cards: - type: custom:vertical-stack-in-card cards: - type: custom:dual-gauge-card title: Температура min: 5 max: 30 outer: entity: sensor.satellite_current_temp label: "Current" unit: "°" inner: entity: input_number.satellite_target_temp label: "Target" unit: "°" colors: - color: "var(--label-badge-red)" value: 23 - color: "var(--label-badge-yellow)" value: 21 - color: "var(--label-badge-green)" value: 18 - color: "var(--label-badge-blue)" value: 15 - color: "var(--paper-blue-400)" value: 0 - type: horizontal-stack cards: - type: "custom:button-card" color_type: blank-card - type: "custom:button-card" color_type: blank-card - type: "custom:button-card" color_type: card color: rgb(60, 60, 60) icon: mdi:minus tap_action: action: call-service service: input_number.decrement service_data: entity_id: input_number.satellite_target_temp styles: card: - width: 100px - height: 30px - type: "custom:button-card" entity: sensor.satellite_target_fs_round color_type: card color: rgb(40, 40, 40) icon: mdi:thermometer show_state: false show_name: false size: 40px tap_action: action: none styles: card: - width: 70px - height: 30px - type: "custom:button-card" color_type: card color: rgb(60, 60, 60) icon: mdi:plus tap_action: action: call-service service: input_number.increment service_data: entity_id: input_number.satellite_target_temp styles: card: - width: 100px - height: 30px - type: "custom:button-card" color_type: blank-card - type: "custom:button-card" color_type: blank-card - type: divider style: height: 10px - type: custom:vertical-stack-in-card cards: - type: custom:dual-gauge-card title: Скорость min: 1 max: 10 outer: entity: sensor.satellite_current_fs label: "Current" inner: entity: sensor.satellite_target_fs_round label: "Target" colors: - color: "#8263b1" value: 0 - type: horizontal-stack cards: - type: "custom:button-card" color_type: blank-card - type: "custom:button-card" color_type: blank-card - type: "custom:button-card" color_type: card color: rgb(60, 60, 60) icon: mdi:minus tap_action: action: call-service service: input_number.decrement service_data: entity_id: input_number.satellite_target_fs styles: card: - width: 100px - height: 30px - type: "custom:button-card" entity: sensor.satellite_target_fs_round color_type: card color: rgb(40, 40, 40) icon: mdi:fan show_state: false show_name: false size: 40px tap_action: action: none styles: card: - width: 70px - height: 30px - type: "custom:button-card" color_type: card color: rgb(60, 60, 60) icon: mdi:plus tap_action: action: call-service service: input_number.increment service_data: entity_id: input_number.satellite_target_fs styles: card: - width: 100px - height: 30px - type: "custom:button-card" color_type: blank-card - type: "custom:button-card" color_type: blank-card - type: divider style: height: 10px
Громов Роман
https://sprut.ai/client/pastes/axRW4QUw
Ventmachine automations.yaml
# Установка скорости вентилятора - alias: "Satellite set fan speed" trigger: platform: state entity_id: input_number.satellite_target_fs action: - service: modbus.write_register data_template: hub: GTC unit: 1 address: 32 value: "{{ (states('input_number.satellite_target_fs'))|int }}" # Обновление статуса скорости вентилятора - alias: "Satellite select fs-select option" trigger: platform: state entity_id: sensor.satellite_target_fs action: - service: input_number.set_value data_template: entity_id: input_number.satellite_target_fs value: "{{ (states('sensor.satellite_target_fs'))|int }}" # Установка температуры - alias: "Satellite set temp" trigger: platform: state entity_id: input_number.satellite_target_temp action: - service: modbus.write_register data_template: hub: GTC unit: 1 address: 31 value: "{{ (((states('input_number.satellite_target_temp'))|float)*10)|int }}" # Обновление статуса температуры - alias: "Satellite select temp-select option" trigger: platform: state entity_id: sensor.satellite_target_temp action: - service: input_number.set_value data_template: entity_id: input_number.satellite_target_temp value: "{{ (states('sensor.satellite_target_temp'))|int }}"
Громов Роман
https://sprut.ai/client/pastes/HRz8yvAP
Ventmachine configuration.yaml
modbus: name: GTC type: tcp host: [satellite_ip] port: 502 sensor: - platform: modbus registers: - name: satellite_target_temp hub: GTC unit_of_measurement: °C slave: 1 register: 31 precision: 1 scale: 0.1 data_type: uint - name: satellite_target_fs hub: GTC slave: 1 register: 32 data_type: uint - name: satellite_current_temp hub: GTC unit_of_measurement: °C slave: 1 register: 7 register_type: input precision: 1 scale: 0.1 data_type: uint - name: satellite_current_fs hub: GTC slave: 1 register: 25 register_type: input data_type: uint input_number: satellite_target_fs: name: satellite_target_fs min: 1 max: 10 step: 1 icon: mdi:fan satellite_target_temp: name: satellite_target_temp min: 5 max: 30 step: 1 icon: mdi:thermometer binary_sensor: - platform: ping name: satellite_ping host: [satellite_ip] scan_interval: 600
Александрович Георгий
https://sprut.ai/client/pastes/2xXRZEHs
Флоу для WLED Homekit через Node-Red
[{"id":"c638bd79.f28ad8","type":"color-convert","z":"50b88df9.790e54","input":"hsv","output":"hex","outputType":"string","scaleInput":false,"x":975,"y":680,"wires":[["202aa699.5c042a"]],"l":false},{"id":"d4901cc1.fb7a48","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"28d350.43349cb","parentService":"c8c25140.a21028","name":"WLED Свет","serviceName":"Lightbulb","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\n \"Brightness\":true,\n \"Hue\":true,\n \"Saturation\":true\n}","x":850,"y":720,"wires":[["e54592f8.20f5a","2b6631de.81dfd6"],[]]},{"id":"c8c25140.a21028","type":"homekit-service","z":"50b88df9.790e54","isParent":true,"bridge":"28d350.43349cb","parentService":"","name":"WLED","serviceName":"Television","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\n\"ActiveIdentifier\":1,\n\"Characteristic.InputSourceType\": \"InputSourceType\"\n}","x":750,"y":840,"wires":[["1e53704a.5d92f8"],[]]},{"id":"f09b1de4.f08568","type":"function","z":"50b88df9.790e54","name":"To homekit","func":"if(msg.topic == \"wled/0d9a4f/g\"){\n if(msg.payload >= \"1\"){\n msg.payload = {\n \"Active\":1\n }\n return [msg];\n }\n if(msg.payload == \"0\"){\n msg.payload = {\n \"Active\":0\n }\n return [msg];\n }\n}","outputs":1,"noerr":0,"x":655,"y":840,"wires":[["c8c25140.a21028"]],"l":false},{"id":"d62ff67f.647588","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 1,\n \"ConfiguredName\": \"Solid\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1060,"wires":[["d5edf8ef.a2a32"]],"l":false},{"id":"d5edf8ef.a2a32","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Solid","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":750,"y":1060,"wires":[[],[]]},{"id":"dc4c4f54.8b436","type":"inject","z":"50b88df9.790e54","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"1","x":595,"y":1060,"wires":[["d62ff67f.647588","45054f06.a09f6","11161ad1.ac5e0d","49ad20a2.1879e8","a1a04aa3.3bb718","f3754b1b.15b7a8","e5387194.70a198","5935872f.a713d8","b93ad337.7525e8","a595d120.541568","d2cffe8.1e1fb8","2766ca74.4fe776","cd29526e.689568","9ab13b5.b7c6548","5dde078e.ca2d98","e79211a6.fde7f","ae0ff7eb.b50db","77b9bb1e.6e483c","7cfbb87d.19cb38","ed0cd734.6735e"]],"l":false},{"id":"d99669e.1d68818","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Blink","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":750,"y":1100,"wires":[[],[]]},{"id":"9a6ff55d.374008","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Wipe","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":750,"y":1140,"wires":[[],[]]},{"id":"21e66b1c.5f9ba4","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Wipe Random","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":780,"y":1180,"wires":[[],[]]},{"id":"b020856a.f71d08","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Random Colors","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":780,"y":1220,"wires":[[],[]]},{"id":"bbc07007.7a8d3","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Sweep","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1260,"wires":[[],[]]},{"id":"4899af70.bcf558","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Dynamic","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1300,"wires":[[],[]]},{"id":"816d1659.9fe318","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Colorloop","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1340,"wires":[[],[]]},{"id":"a65d7936.46d198","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Rainbow","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1380,"wires":[[],[]]},{"id":"45054f06.a09f6","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 2,\n \"ConfiguredName\": \"Blink\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1100,"wires":[["d99669e.1d68818"]],"l":false},{"id":"11161ad1.ac5e0d","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 3,\n \"ConfiguredName\": \"Wipe\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1140,"wires":[["9a6ff55d.374008"]],"l":false},{"id":"49ad20a2.1879e8","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 4,\n \"ConfiguredName\": \"Wipe Random\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1180,"wires":[["21e66b1c.5f9ba4"]],"l":false},{"id":"a1a04aa3.3bb718","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 5,\n \"ConfiguredName\": \"Random Colors\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1220,"wires":[["b020856a.f71d08"]],"l":false},{"id":"f3754b1b.15b7a8","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 6,\n \"ConfiguredName\": \"Sweep\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1260,"wires":[["bbc07007.7a8d3"]],"l":false},{"id":"e5387194.70a198","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 7,\n \"ConfiguredName\": \"Dynamic\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1300,"wires":[["4899af70.bcf558"]],"l":false},{"id":"5935872f.a713d8","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 8,\n \"ConfiguredName\": \"Colorloop\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1340,"wires":[["816d1659.9fe318"]],"l":false},{"id":"b93ad337.7525e8","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 9,\n \"ConfiguredName\": \"Rainbow\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1380,"wires":[["a65d7936.46d198"]],"l":false},{"id":"e9a44fa4.5835f","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Scan","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":750,"y":1420,"wires":[[],[]]},{"id":"a595d120.541568","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 10,\n \"ConfiguredName\": \"Scan\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1420,"wires":[["e9a44fa4.5835f"]],"l":false},{"id":"10a5ce9d.5dc051","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Dual Scan","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":770,"y":1460,"wires":[[],[]]},{"id":"d2cffe8.1e1fb8","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 11,\n \"ConfiguredName\": \"Dual Scan\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1460,"wires":[["10a5ce9d.5dc051"]],"l":false},{"id":"67f32f76.8a5678","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Fireworks 1D","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":770,"y":1500,"wires":[[],[]]},{"id":"2766ca74.4fe776","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 12,\n \"ConfiguredName\": \"Fireworks 1D\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1500,"wires":[["67f32f76.8a5678"]],"l":false},{"id":"3ccd452e.b4b3d2","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Theater","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1540,"wires":[[],[]]},{"id":"cd29526e.689568","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 13,\n \"ConfiguredName\": \"Theater\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1540,"wires":[["3ccd452e.b4b3d2"]],"l":false},{"id":"acd5c10e.6084f","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Theater Rainbow","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":790,"y":1580,"wires":[[],[]]},{"id":"9ab13b5.b7c6548","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 14,\n \"ConfiguredName\": \"Theater Rainbow\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1580,"wires":[["acd5c10e.6084f"]],"l":false},{"id":"89c2ecd7.ea80a","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Running","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1620,"wires":[[],[]]},{"id":"5dde078e.ca2d98","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 15,\n \"ConfiguredName\": \"Running\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1620,"wires":[["89c2ecd7.ea80a"]],"l":false},{"id":"8d83852d.193f3","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Saw","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":750,"y":1660,"wires":[[],[]]},{"id":"e79211a6.fde7f","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 16,\n \"ConfiguredName\": \"Saw\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1660,"wires":[["8d83852d.193f3"]],"l":false},{"id":"15903f59.97d7b1","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Twinkle","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1700,"wires":[[],[]]},{"id":"ae0ff7eb.b50db","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 17,\n \"ConfiguredName\": \"Twinkle\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1700,"wires":[["15903f59.97d7b1"]],"l":false},{"id":"2dabd8d4.ca3298","type":"function","z":"50b88df9.790e54","name":"To MQTT","func":"if(msg.hap.context !== undefined){\n\nif(msg.payload.ActiveIdentifier === 1){return [null,{payload: 'FX=0'}];}\nif(msg.payload.ActiveIdentifier === 2){return [null,{payload: 'FX=1'}];}\nif(msg.payload.ActiveIdentifier === 3){return [null,{payload: 'FX=3'}];}\nif(msg.payload.ActiveIdentifier === 4){return [null,{payload: 'FX=4'}];}\nif(msg.payload.ActiveIdentifier === 5){return [null,{payload: 'FX=5'}];}\nif(msg.payload.ActiveIdentifier === 6){return [null,{payload: 'FX=6'}];}\nif(msg.payload.ActiveIdentifier === 7){return [null,{payload: 'FX=7'}];}\nif(msg.payload.ActiveIdentifier === 8){return [null,{payload: 'FX=8'}];}\nif(msg.payload.ActiveIdentifier === 9){return [null,{payload: 'FX=9'}];}\nif(msg.payload.ActiveIdentifier === 10){return [null,{payload: 'FX=10'}];}\nif(msg.payload.ActiveIdentifier === 11){return [null,{payload: 'FX=11'}];}\nif(msg.payload.ActiveIdentifier === 12){return [null,{payload: 'FX=90'}];}\nif(msg.payload.ActiveIdentifier === 13){return [null,{payload: 'FX=13'}];}\nif(msg.payload.ActiveIdentifier === 14){return [null,{payload: 'FX=14'}];}\nif(msg.payload.ActiveIdentifier === 15){return [null,{payload: 'FX=15'}];}\nif(msg.payload.ActiveIdentifier === 16){return [null,{payload: 'FX=16'}];}\nif(msg.payload.ActiveIdentifier === 17){return [null,{payload: 'FX=17'}];}\nif(msg.payload.ActiveIdentifier === 18){return [null,{payload: 'FX=18'}];}\nif(msg.payload.ActiveIdentifier === 19){return [null,{payload: 'FX=19'}];}\nif(msg.payload.ActiveIdentifier === 20){return [null,{payload: 'FX=20'}];}\nif(msg.payload.Active === 1){return [{payload: \"T=1\"},null];}\nif(msg.payload.Active === 0){return [{payload: \"T=0\"},null];}\n}","outputs":2,"noerr":0,"x":895,"y":840,"wires":[["7857ec8b.b7b60c"],["7857ec8b.b7b60c"]],"l":false},{"id":"f0197860.4039d8","type":"function","z":"50b88df9.790e54","name":"Effect to HK","func":"if(msg.payload === '0') return {payload: '1'};\nif(msg.payload === '1') return {payload: '2'};\nif(msg.payload === '3') return {payload: '3'};\nif(msg.payload === '4') return {payload: '4'};\nif(msg.payload === '5') return {payload: '5'};\nif(msg.payload === '6') return {payload: '6'};\nif(msg.payload === '7') return {payload: '7'};\nif(msg.payload === '8') return {payload: '8'};\nif(msg.payload === '9') return {payload: '9'};\nif(msg.payload === '10') return {payload: '10'};\nif(msg.payload === '11') return {payload: '11'};\nif(msg.payload === '90') return {payload: '12'};\nif(msg.payload === '13') return {payload: '13'};\nif(msg.payload === '13') return {payload: '14'};\nif(msg.payload === '15') return {payload: '15'};\nif(msg.payload === '16') return {payload: '16'};\nif(msg.payload === '17') return {payload: '17'};\nif(msg.payload === '18') return {payload: '18'};\nif(msg.payload === '19') return {payload: '19'};\nif(msg.payload === '20') return {payload: '20'};","outputs":1,"noerr":0,"x":835,"y":780,"wires":[["3903ae11.2d4792"]],"l":false},{"id":"3903ae11.2d4792","type":"change","z":"50b88df9.790e54","name":"ActiveIdentifier","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.ActiveIdentifier","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":895,"y":780,"wires":[["c8c25140.a21028"]],"l":false},{"id":"7857ec8b.b7b60c","type":"mqtt out","z":"50b88df9.790e54","name":"","topic":"wled/0d9a4f/api","qos":"","retain":"","broker":"10714da3.f179fa","x":1055,"y":840,"wires":[],"l":false},{"id":"470383aa.d8f4b4","type":"mqtt in","z":"50b88df9.790e54","name":"On/Off","topic":"wled/0d9a4f/g","qos":"2","datatype":"auto","broker":"10714da3.f179fa","x":570,"y":840,"wires":[["f09b1de4.f08568","1f631d39.b29b93"]]},{"id":"a2eaba2.4260348","type":"xml","z":"50b88df9.790e54","name":"","property":"payload","attr":"","chr":"","x":655,"y":780,"wires":[["c41ffe3f.0a504"]],"l":false},{"id":"eb332fad.d6f05","type":"mqtt in","z":"50b88df9.790e54","name":"Effects","topic":"wled/0d9a4f/v","qos":"2","datatype":"auto","broker":"10714da3.f179fa","x":570,"y":780,"wires":[["a2eaba2.4260348"]]},{"id":"c41ffe3f.0a504","type":"split","z":"50b88df9.790e54","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":715,"y":780,"wires":[["712142dc.e2f57c","f269ff04.78dc48","8f9a5967.a42578"]],"l":false},{"id":"712142dc.e2f57c","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.fx[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":775,"y":780,"wires":[["f0197860.4039d8"]],"l":false},{"id":"76330046.168b2","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Скорость Эффектов","serviceName":"Fanv2","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{\n \"RotationSpeed\":true\n}","x":800,"y":920,"wires":[["eb09ace4.61f758"],[]]},{"id":"d34492d1.69dc98","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Насыщенность Эффектов","serviceName":"Fanv2","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{\n \"SwingMode\":true,\n \"RotationSpeed\":true\n}","x":820,"y":1020,"wires":[["af5f4389.7ab9d"],[]]},{"id":"3ae0b823.120e3","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.Brightness","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"100","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":975,"y":760,"wires":[["720e9a84.3cc544"]],"l":false},{"id":"e0233ef2.35c598","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.Brightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":735,"y":720,"wires":[["62394483.1d13bc","d4901cc1.fb7a48"]],"l":false},{"id":"1f631d39.b29b93","type":"function","z":"50b88df9.790e54","name":"","func":"var bri = Number(msg.payload)/2.55;\nbri = Math.round(bri);\nmsg.payload = bri;\nreturn msg;","outputs":1,"noerr":0,"x":675,"y":720,"wires":[["e0233ef2.35c598"]],"l":false},{"id":"62394483.1d13bc","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.Brightness","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":675,"y":680,"wires":[["56cac60.2795bbc"],["607622cb.5c2e34"]],"l":false},{"id":"56cac60.2795bbc","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.Brightness","pt":"msg","to":"payload.On","tot":"msg"},{"t":"set","p":"payload.On","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":735,"y":680,"wires":[["d4901cc1.fb7a48"]],"l":false},{"id":"607622cb.5c2e34","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.Brightness","pt":"msg","to":"payload.On","tot":"msg"},{"t":"set","p":"payload.On","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":795,"y":680,"wires":[["d4901cc1.fb7a48"]],"l":false},{"id":"e54592f8.20f5a","type":"function","z":"50b88df9.790e54","name":"","func":"var Hue = flow.get('Hue')||0;\nvar Saturation = flow.get('Saturation')||0;\nvar Brightness = flow.get('Brightness')||100;\n\nif(msg.payload.Hue){\n Hue = msg.payload.Hue;\n flow.set('Hue',Hue);\n}\nif(msg.payload.Saturation){\n Saturation = msg.payload.Saturation;\n flow.set('Saturation',Saturation);\n}\nif(msg.payload.Brightness){\n Brightness = msg.payload.Brightness;\n flow.set('Brightness',Brightness);\n}\nif (msg.hap.context !== undefined) {\n if(msg.payload.On === true){\n return [{\"payload\":[Hue,Saturation,Brightness]}]\n }\n if(msg.payload.On === false){\n return [{\"payload\":[0,0,0]}]\n }\n else{\n return [{\"payload\":[Hue,Saturation,Brightness]}]\n }\n}","outputs":1,"noerr":0,"x":855,"y":680,"wires":[["d1b8383b.cbd078"]],"l":false},{"id":"202aa699.5c042a","type":"function","z":"50b88df9.790e54","name":"","func":"msg.payload= \"CL=\"+msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":975,"y":840,"wires":[["7857ec8b.b7b60c"]],"l":false},{"id":"b6cad84c.6b407","type":"function","z":"50b88df9.790e54","name":"","func":"var speed = msg.payload.RotationSpeed*2.55;\nspeed = Math.round(speed);\nvar spe = \"SX=\"+speed;\nmsg.payload = spe;\nreturn msg;","outputs":1,"noerr":0,"x":995,"y":880,"wires":[["7857ec8b.b7b60c"]],"l":false},{"id":"3cedaaa6.e213be","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.RotationSpeed","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"100","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":935,"y":880,"wires":[["b6cad84c.6b407"]],"l":false},{"id":"f269ff04.78dc48","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.sx[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":535,"y":920,"wires":[["ee8eb3df.e687f"]],"l":false},{"id":"ee8eb3df.e687f","type":"function","z":"50b88df9.790e54","name":"","func":"var spe = Number(msg.payload)/2.55;\nspe = Math.round(spe);\nmsg.payload = spe;\nreturn msg;","outputs":1,"noerr":0,"x":595,"y":920,"wires":[["769943bd.a20b34"]],"l":false},{"id":"769943bd.a20b34","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.RotationSpeed","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":920,"wires":[["76330046.168b2","89d3ce39.af71e"]],"l":false},{"id":"89d3ce39.af71e","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.RotationSpeed","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":655,"y":880,"wires":[["f69db57d.3bfcd8"],["b2761c65.26e218"]],"l":false},{"id":"f69db57d.3bfcd8","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.RotationSpeed","pt":"msg","to":"payload.Active","tot":"msg"},{"t":"set","p":"payload.Active","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":715,"y":880,"wires":[["76330046.168b2"]],"l":false},{"id":"b2761c65.26e218","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.RotationSpeed","pt":"msg","to":"payload.Active","tot":"msg"},{"t":"set","p":"payload.Active","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":775,"y":880,"wires":[["76330046.168b2"]],"l":false},{"id":"6f0b90ff.7691e8","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.SwingMode","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":935,"y":960,"wires":[["d3049e72.ac667"],["9abab4ce.b86e5"]],"l":false},{"id":"8f9a5967.a42578","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.ix[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":535,"y":1020,"wires":[["9febfddf.527bd8"]],"l":false},{"id":"9febfddf.527bd8","type":"function","z":"50b88df9.790e54","name":"","func":"var spe = Number(msg.payload)/2.55;\nspe = Math.round(spe);\nmsg.payload = spe;\nreturn msg;","outputs":1,"noerr":0,"x":595,"y":1020,"wires":[["8415b162.9ccad"]],"l":false},{"id":"8415b162.9ccad","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.RotationSpeed","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":1020,"wires":[["d34492d1.69dc98","9dfb9361.bcead"]],"l":false},{"id":"9dfb9361.bcead","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.RotationSpeed","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":535,"y":960,"wires":[["2bb6530b.1cb034"],["7f048b24.a413e4"]],"l":false},{"id":"2bb6530b.1cb034","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.RotationSpeed","pt":"msg","to":"payload.Active","tot":"msg"},{"t":"set","p":"payload.Active","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":615,"y":960,"wires":[["d34492d1.69dc98"]],"l":false},{"id":"7f048b24.a413e4","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"move","p":"payload.RotationSpeed","pt":"msg","to":"payload.Active","tot":"msg"},{"t":"set","p":"payload.Active","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":675,"y":960,"wires":[["d34492d1.69dc98"]],"l":false},{"id":"98716030.7f96c","type":"switch","z":"50b88df9.790e54","name":"","property":"payload.RotationSpeed","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"100","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":735,"y":960,"wires":[["55ff0f24.37672"]],"l":false},{"id":"55ff0f24.37672","type":"function","z":"50b88df9.790e54","name":"","func":"var speed = msg.payload.RotationSpeed*2.55;\nspeed = Math.round(speed);\nvar spe = \"IX=\"+speed;\nmsg.payload = spe;\nreturn msg;","outputs":1,"noerr":0,"x":795,"y":960,"wires":[["7857ec8b.b7b60c"]],"l":false},{"id":"156a1df8.213cb2","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Dissolve","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1740,"wires":[[],[]]},{"id":"77b9bb1e.6e483c","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 18,\n \"ConfiguredName\": \"Dissolve\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1740,"wires":[["156a1df8.213cb2"]],"l":false},{"id":"65f61298.2c5fb4","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Dissolve Rnd","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":770,"y":1780,"wires":[[],[]]},{"id":"7cfbb87d.19cb38","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 19,\n \"ConfiguredName\": \"Dissolve Rnd\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1780,"wires":[["65f61298.2c5fb4"]],"l":false},{"id":"ca6468b8.71b83","type":"homekit-service","z":"50b88df9.790e54","isParent":false,"bridge":"","parentService":"c8c25140.a21028","name":"Sparkle","serviceName":"InputSource","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigInterfaceName":"","characteristicProperties":"{}","x":760,"y":1820,"wires":[[],[]]},{"id":"ed0cd734.6735e","type":"function","z":"50b88df9.790e54","name":"Configuration","func":"msg.payload = {\n \"IsConfigured\" : 1,\n \"Identifier\": 20,\n \"ConfiguredName\": \"Sparkle\",\n \"InputSourceType\": 10\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":655,"y":1820,"wires":[["ca6468b8.71b83"]],"l":false},{"id":"d521508c.23165","type":"switch","z":"50b88df9.790e54","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":995,"y":920,"wires":[["a71f3ffc.5928e"],["fd870710.17e928"]],"l":false},{"id":"a71f3ffc.5928e","type":"function","z":"50b88df9.790e54","name":"Effects Num","func":"let items = [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]\nmsg.payload = items[Math.floor(Math.random() * items.length)]\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":880,"wires":[["fd870710.17e928","88c5b4fb.dd233"]]},{"id":"fd870710.17e928","type":"trigger","z":"50b88df9.790e54","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"10","extend":false,"units":"s","reset":"false","bytopic":"all","name":"","x":1190,"y":940,"wires":[["a71f3ffc.5928e"]]},{"id":"88c5b4fb.dd233","type":"function","z":"50b88df9.790e54","name":"","func":"msg.payload= \"FX=\"+msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":1315,"y":880,"wires":[["e2959255.eedce"]],"l":false},{"id":"e2959255.eedce","type":"rbe","z":"50b88df9.790e54","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1375,"y":880,"wires":[["7857ec8b.b7b60c"]],"l":false},{"id":"d3049e72.ac667","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":935,"y":920,"wires":[["d521508c.23165"]],"l":false},{"id":"9abab4ce.b86e5","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":995,"y":960,"wires":[["d521508c.23165"]],"l":false},{"id":"1e53704a.5d92f8","type":"switch","z":"50b88df9.790e54","name":"","property":"hap.context","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":835,"y":840,"wires":[["2dabd8d4.ca3298"]],"l":false},{"id":"2b6631de.81dfd6","type":"switch","z":"50b88df9.790e54","name":"","property":"hap.context","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":975,"y":720,"wires":[["3ae0b823.120e3"]],"l":false},{"id":"eb09ace4.61f758","type":"switch","z":"50b88df9.790e54","name":"","property":"hap.context","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":875,"y":880,"wires":[["3cedaaa6.e213be"]],"l":false},{"id":"af5f4389.7ab9d","type":"switch","z":"50b88df9.790e54","name":"","property":"hap.context","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":875,"y":960,"wires":[["6f0b90ff.7691e8","98716030.7f96c"]],"l":false},{"id":"a02e1f46.6d143","type":"mqtt out","z":"50b88df9.790e54","name":"","topic":"wled/0d9a4f","qos":"","retain":"","broker":"10714da3.f179fa","x":1055,"y":780,"wires":[],"l":false},{"id":"d1b8383b.cbd078","type":"change","z":"50b88df9.790e54","name":"","rules":[{"t":"set","p":"payload[2]","pt":"msg","to":"100","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":915,"y":680,"wires":[["c638bd79.f28ad8"]],"l":false},{"id":"720e9a84.3cc544","type":"function","z":"50b88df9.790e54","name":"","func":"var bright = msg.payload.Brightness*2.55;\nbright = Math.round(bright);\nmsg.payload = bright;\nreturn msg;","outputs":1,"noerr":0,"x":975,"y":800,"wires":[["a02e1f46.6d143"]],"l":false},{"id":"28d350.43349cb","type":"homekit-bridge","z":"","bridgeName":"WLED","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":false},{"id":"10714da3.f179fa","type":"mqtt-broker","z":"","name":"local","broker":"mqtt://localhost","port":"1883","tls":"6b096454.81ff8c","clientid":"","usetls":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"6b096454.81ff8c","type":"tls-config","z":"","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":true}]
Жабунин Александр
https://sprut.ai/client/pastes/e5neN2aS
Brightness.sh
#!/bin/bash current=$(/class/backlight/intel_backlight/brightness) if [ $1 -gt $current ] then for ((i=$current;i<=$1;i++)); do echo $i > /sys/class/backlight/intel_backlight/brightness sleep 0.01 done elif [ $current -gt $1 ] then for ((i=$current;i>=$1;i--)); do echo $i > /sys/class/backlight/intel_backlight/brightness sleep 0.01 done fi exit 0
Никольский Виталий Борисович
https://sprut.ai/client/pastes/F42n7Nka
Алгоритм регулировки окна на основе показаний CO2
[{"id":"646f4fb4.21e6e8","type":"tab","label":"CO2 - привод","disabled":false,"info":""},{"id":"72da263f.8a6368","type":"join","z":"646f4fb4.21e6e8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"10","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":350,"y":200,"wires":[["b059b686.8eaab"]]},{"id":"50b55822.1958c8","type":"function","z":"646f4fb4.21e6e8","name":"","func":"function isIncreasing(xs) {\n// Грузим массив в переменную\n var ar = [msg.payload]; \n// Тут мы вычисляем среднее значение из всего массива \n\tlet mid = msg.payload.map(function(num) { return parseInt(num) });\n let total = mid.reduce((a, b) => a + b)\n let avg = Math.round(total / mid.length);\n\n// Начинаем цикл обработки значений путем \n// вычисления разницы между последующим и \n// предыдущим членом массива\n for (var i = 0; i < xs.length; i++) {\n \tvar cur, next;\n\n cur = xs[i];\n\n if (i < xs.length - 1) {\n \tnext = xs[i + 1];\n } else {\n \tbreak\n }\n\n var dif = next - cur;\n ar.push(dif)\n }\n// Тут мы начинаем вычислять сколько положительных\n// отрицательных или нулевых значений у нас получилсось\n\n var pos = 0\n var neg = 0\n var zero = 0\n\n ar.forEach(element => {\n \tif (element > 0) {\n \t\tpos++;\n \t} else if (element < 0) {\n \t\tneg++;\n \t} else {\n \t\tzero++;\n \t}\n \t\n });\n let obj = {\n \t\"increasing\": pos,\n \t\"decreasing\": neg,\n \t\"freeze\": zero\n }\n// Тут мы вычисляем каких больше, положительных,\n// отрицательных или нулевых результатов больше\n let max = Object.keys(obj).reduce(function(a, b){ return obj[a] > obj[b] ? a : b });\n// Назначаем глобальное значение со2 равное среднему\n global.set('co2',avg);\n\n// выводим результаты. По сути нам нужны далее\n// только max и avg, причем последний справочно\n return {\n \t\"pos\": pos,\n \t\"neg\": neg,\n \t\"zero\": zero,\n \t\"max\": max,\n \t\"avg\": avg,\n \t\"mid\": mid\n }\n\n \n}\nconsole.log(isIncreasing([1, 2, 3, 4]));\nreturn isIncreasing(msg.payload)\n","outputs":1,"noerr":0,"x":630,"y":200,"wires":[["7fd8dadc.67e5fc"]]},{"id":"7fd8dadc.67e5fc","type":"function","z":"646f4fb4.21e6e8","name":"counter","func":"// Позиция окна берется из глобал\nvar window_pos = global.get('window_current');\nvar wind = global.get('weather.wind');\nvar templimit = Math.round(global.get('bedroom.templimit') * 100)/100||22.2;\nvar temp = Math.round(global.get('bedroom.temp') * 100)/100;\n// переменная определяющая работает регулирование или выключено\nvar operation = global.get('bedroom.window_auto');\n// получаем из предыдущей ноды состояние со2\n// что дает нам понимание что надо дальше делать\nvar state = msg.max;\n// переменная итогового значения привода \nvar count = {};\n// переменная шага привода\nvar offset = {};\n// лимиты значений для привода\nvar upperlimit = 100;\nvar lowerlimit = 0;\n// переменная для хранения прошлого значения для привода\nvar previous_count = flow.get(\"previous_count\")||0;\n// основная переменная со2, может браться и из глобал\nvar co2 = msg.avg;\n\n// при старте нодереда, часто не успевают \n// назначиться глобальные переменные\n// поэтому мы их принудительно объявляем\nif (wind === \"undefined\") {wind = 7;}\nif (temp === \"undefined\") {temp = templimit;}\nif (window_pos === \"undefined\") {window_pos = 0;}\n\n// если при значениях со2 выше 800 у нас получилась полка\n// то есть значения не меняются, то мы все равно командуем\n// открыть окно чтобы снизить уровень\nif ((co2 > 800) && (state === \"freeze\")) {state = \"increasing\";}\n\n// это целевой коридор, то есть если показания \n// со2 находятся в нем, то мы ничего с приводом\n// не делаем\nif ((co2 < 700) && (co2 > 600)) {state = \"freeze\";}\n\n// если со2 меньше 600 и тоже полка, то мы прикрываем \n// окно, чтобы оно у нас не болталось открытым\n// помогает когда никого нет дома\nif ((co2 < 600) && (state === \"freeze\")) {state = \"decreasing\";}\n\n// если показатели больше 800 и меньше 500, то \n// шаг равен 5, если между, то равен 2\nif (co2 > 800) {offset = 5;} else if (co2 < 500) {offset = 5;} else {offset = 2;}\n// если ветер больше 7, то шаг делим на 2 \n// и округляем до целого числа\nif (wind > 7) {offset = Math.round(offset/2);}\n\n\n// непосредственно расчет нового значения для привода\n// если состояние после всех порогов - increasing то \n// есть увеличение, то к текущему положению окна прибавляется шаг\nif (state === \"increasing\") {\n count =(window_pos + offset);\n} else if (state === \"decreasing\") {\n// если уменьшение то отнимаем порог\n count = (window_pos - offset);\n} else if (state === \"freeze\") {\n// если freeze значит стоим на месте\n count = (window_pos);\n}\n// если математически, новое значение больше\n// установленных пределов, то оно приравнивается\n// к верхнему или нижнему максимальному пределу\nif (count > upperlimit) { count = upperlimit; }\nif (count < lowerlimit) { count = lowerlimit; }\n\n// Если температура в помещении ниже указанной\n// а со2 ниже 1000, то окно закрывается, чтобы \n// комната нагрелась\n\nif ((temp <= templimit) && (co2 <= 1000)) {count = lowerlimit;}\n\n\n// это для выводов статусов ноды для проверки\n\n// node.status({fill:\"green\",shape:\"ring\",\"text\": \"CO2: \" + co2 + \" %: \" + count +\" Wind: \" + wind + \" T: \" + temp});\n// node.status({fill:\"green\",shape:\"ring\",\"text\": templimit});\nnode.status({fill:\"green\",shape:\"ring\",\"text\": \"Wind: \" + wind + \" Temp: \" + temp + \" % \" + count});\n\n\n// Если вычисленное значение отличается от предыдущего\n// тогда мы отправляем его дальше\nif (count != window_pos) {\nmsg.payload = count;\nflow.set('previous_count',count);\nreturn msg;\n }\n// если новое значение равно предыдущему, то мы ничего не отправляем\nelse { flow.set('previous_count',count);}\n\nreturn null\n","outputs":1,"noerr":0,"x":780,"y":200,"wires":[["3e57d506.42b8d2"]]},{"id":"3e57d506.42b8d2","type":"debug","z":"646f4fb4.21e6e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":910,"y":200,"wires":[]},{"id":"b059b686.8eaab","type":"switch","z":"646f4fb4.21e6e8","name":"Auto","property":"bedroom.window_auto","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":200,"wires":[["50b55822.1958c8"]]},{"id":"f45c2ce5.58573","type":"inject","z":"646f4fb4.21e6e8","name":"enable","topic":"enable","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"onceDelay":"","x":230,"y":300,"wires":[["80b09f5d.7a306"]]},{"id":"78e8f8e9.a1d558","type":"inject","z":"646f4fb4.21e6e8","name":"disable","topic":"enable","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"x":230,"y":340,"wires":[["80b09f5d.7a306"]]},{"id":"80b09f5d.7a306","type":"change","z":"646f4fb4.21e6e8","name":"Bedroom Window Auto","rules":[{"t":"set","p":"bedroom.window_auto","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":320,"wires":[[]]},{"id":"7b23b5ea.cd0144","type":"inject","z":"646f4fb4.21e6e8","name":"Templimit 22.2","topic":"","payload":"22.2","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":260,"y":420,"wires":[["d0593406.56bfe8"]]},{"id":"bf71b794.9bf138","type":"inject","z":"646f4fb4.21e6e8","name":"Templimit 25","topic":"","payload":"25","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":460,"wires":[["d0593406.56bfe8"]]},{"id":"d0593406.56bfe8","type":"change","z":"646f4fb4.21e6e8","name":"Templimit Global","rules":[{"t":"set","p":"bedroom.templimit","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":440,"wires":[[]]}]
Бродкин Константин Владимирович
https://sprut.ai/client/pastes/cc2va6Ga
flow Умная сауна в WB6
[{"id":"8e15de5c.404018","type":"tab","label":"Умная сауна в WB6","disabled":false,"info":""},{"id":"6d5ea.f5100a16","type":"http request","z":"8e15de5c.404018","name":"Запрос состояния сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/get/m2m/inputs?type=specific&number=All&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":80,"wires":[["70ee9466.2a614c","e673bead.15a628","401b3841.7a2de","54a60146.2f6648","6eaea1d3.df8fa8","3df677f9.336ad","a3257b59.170108","4a6c95c5.0b9d7c","d755c975.148eb","e17b6b3c.205eb","121f438.c75293d","ed73474f.be1e2","de9bb8b9.21e6","cc78ef3a.bf719","98c043e7.27929","eba2d4d4.6eb3b8"]]},{"id":"3a4e99a8.8527be","type":"inject","z":"8e15de5c.404018","name":"Каждые 5 сек","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":40,"wires":[["6d5ea.f5100a16"]]},{"id":"70ee9466.2a614c","type":"change","z":"8e15de5c.404018","name":"MainPower_switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.switchers.MainPower_switch","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":140,"wires":[["841df77e.a1e1a8","9379335b.d594e8","e7567d45.e3e738"]]},{"id":"841df77e.a1e1a8","type":"debug","z":"8e15de5c.404018","name":"Главный выключатель","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":870,"y":100,"wires":[]},{"id":"e673bead.15a628","type":"change","z":"8e15de5c.404018","name":"Heat_switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.switchers.Heat_switch","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":240,"wires":[["214b9f80.d20a48","d10d9bc1.60252","f3d75f9c.bc4a08"]]},{"id":"214b9f80.d20a48","type":"debug","z":"8e15de5c.404018","name":"Нагрев","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":820,"y":200,"wires":[]},{"id":"236b4bd5.aaa114","type":"comment","z":"8e15de5c.404018","name":"Запрос состояния сауны","info":"","x":350,"y":40,"wires":[]},{"id":"401b3841.7a2de","type":"change","z":"8e15de5c.404018","name":"Humidity_switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.switchers.Humidity_switch","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":340,"wires":[["34b011cb.e7a1ee","a5bb6112.85577","bf0e0eb1.f4aaa8"]]},{"id":"34b011cb.e7a1ee","type":"debug","z":"8e15de5c.404018","name":"Увлажнение","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":830,"y":300,"wires":[]},{"id":"54a60146.2f6648","type":"change","z":"8e15de5c.404018","name":"Fan_switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.switchers.Fan_switch","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":440,"wires":[["2588d6c7.4c187a","6f5a406a.6455","41c25204.a804b4"]]},{"id":"2588d6c7.4c187a","type":"debug","z":"8e15de5c.404018","name":"Вентиляция","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":830,"y":400,"wires":[]},{"id":"6eaea1d3.df8fa8","type":"change","z":"8e15de5c.404018","name":"Light_switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.switchers.Light_switch","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":540,"wires":[["a2e7c678.541c2","504c3a87.26a6ec","cd4e53e2.0703d"]]},{"id":"a2e7c678.541c2","type":"debug","z":"8e15de5c.404018","name":"Освещение","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":830,"y":500,"wires":[]},{"id":"3df677f9.336ad","type":"change","z":"8e15de5c.404018","name":"TimerOffset_chekbox","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.timers.TimerOffset_checkbox","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":640,"wires":[["e041863e.5f7808","f019f37.937a21","c443709e.553918"]]},{"id":"e041863e.5f7808","type":"debug","z":"8e15de5c.404018","name":"Таймер ВКЛ","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":830,"y":600,"wires":[]},{"id":"a3257b59.170108","type":"change","z":"8e15de5c.404018","name":"TimerOffset_time_SET","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.timers.TimerOffset_time_SET","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":740,"wires":[["e2000b12.fa47","7f8ed1e7.4c2b8","3a67d73f.391158"]]},{"id":"e2000b12.fa47","type":"debug","z":"8e15de5c.404018","name":"Уставка таймера","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":850,"y":700,"wires":[]},{"id":"4a6c95c5.0b9d7c","type":"change","z":"8e15de5c.404018","name":"TimerOffset_time_REAL","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.timers.TimerOffset_time_REAL","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":840,"wires":[["7129b0.0923ce5","d6074458.2e0d"]]},{"id":"7129b0.0923ce5","type":"debug","z":"8e15de5c.404018","name":"Остаток таймера","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":850,"y":800,"wires":[]},{"id":"d755c975.148eb","type":"change","z":"8e15de5c.404018","name":"TimeHeat_SET","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.timers.TimeHeat_SET","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":940,"wires":[["5c5fd614.bdd1b","45830fd3.8d682","f35899f2.856008"]]},{"id":"5c5fd614.bdd1b","type":"debug","z":"8e15de5c.404018","name":"Уставка времени нагрева","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":840,"y":900,"wires":[]},{"id":"e17b6b3c.205eb","type":"change","z":"8e15de5c.404018","name":"TimeHeat_REAL","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.timers.TimeHeat_REAL","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1040,"wires":[["829136e4.ef99f8","52ef8d0b.f244cc"]]},{"id":"829136e4.ef99f8","type":"debug","z":"8e15de5c.404018","name":"Остаток времени нагрева","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":840,"y":1000,"wires":[]},{"id":"121f438.c75293d","type":"change","z":"8e15de5c.404018","name":"Temperature_SET","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.sensors.Temperature_SET","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1140,"wires":[["ada6122.4cf5af","77506427.f53c1c","64724c6a.5a4334"]]},{"id":"ada6122.4cf5af","type":"debug","z":"8e15de5c.404018","name":"Уставка температуры","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":820,"y":1100,"wires":[]},{"id":"ed73474f.be1e2","type":"change","z":"8e15de5c.404018","name":"Temperature_REAL","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.sensors.Temperature_REAL","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1240,"wires":[["938a5b0a.241358","7dc3704b.8e3908"]]},{"id":"938a5b0a.241358","type":"debug","z":"8e15de5c.404018","name":"Температура","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":800,"y":1200,"wires":[]},{"id":"de9bb8b9.21e6","type":"change","z":"8e15de5c.404018","name":"Humidity_SET","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.sensors.Humidity_SET","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1340,"wires":[["6745c78.f9453b8","145c01ae.75d7c6","746426bd.3d2378"]]},{"id":"6745c78.f9453b8","type":"debug","z":"8e15de5c.404018","name":"Уставка влажности","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":820,"y":1300,"wires":[]},{"id":"cc78ef3a.bf719","type":"change","z":"8e15de5c.404018","name":"Humidity_REAL","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.sensors.Humidity_REAL","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1440,"wires":[["7f9fc2.a6dfc84","c466d417.e5db3"]]},{"id":"7f9fc2.a6dfc84","type":"debug","z":"8e15de5c.404018","name":"Влажность","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":790,"y":1400,"wires":[]},{"id":"98c043e7.27929","type":"change","z":"8e15de5c.404018","name":"Light_dimmer","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].value.dimmers.Light_dimmer","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1540,"wires":[["78061649.b8d3c8","6986771a.6a4af","ca7d4794.695f28"]]},{"id":"78061649.b8d3c8","type":"debug","z":"8e15de5c.404018","name":"Диммер освещения","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":820,"y":1500,"wires":[]},{"id":"eba2d4d4.6eb3b8","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.inputs.data[0].error_ch","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1640,"wires":[["99e75579.cbc638","ab194c8f.055528"]]},{"id":"99e75579.cbc638","type":"debug","z":"8e15de5c.404018","name":"Ошибка","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":760,"y":1600,"wires":[]},{"id":"e7567d45.e3e738","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/MainPower_switch","command":"","commandType":"str","payload":"payload","payloadType":"msg","x":1110,"y":140,"wires":[]},{"id":"7dc3704b.8e3908","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Temperature_REAL","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1120,"y":1240,"wires":[]},{"id":"f3d75f9c.bc4a08","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Heat_switch","command":"","commandType":"str","payload":"payload","payloadType":"msg","x":1090,"y":240,"wires":[]},{"id":"a5bb6112.85577","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Humidity_switch","command":"","commandType":"str","payload":"payload","payloadType":"msg","x":1100,"y":340,"wires":[]},{"id":"6f5a406a.6455","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Fan_switch","command":"","commandType":"str","payload":"payload","payloadType":"msg","x":1090,"y":440,"wires":[]},{"id":"504c3a87.26a6ec","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Light_switch","command":"","commandType":"str","payload":"payload","payloadType":"msg","x":1090,"y":540,"wires":[]},{"id":"f019f37.937a21","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimerOffset_checkbox","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1120,"y":640,"wires":[]},{"id":"7f8ed1e7.4c2b8","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimerOffset_time_SET","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1130,"y":740,"wires":[]},{"id":"d6074458.2e0d","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimerOffset_time_REAL","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1130,"y":840,"wires":[]},{"id":"45830fd3.8d682","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimeHeat_SET","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1100,"y":940,"wires":[]},{"id":"52ef8d0b.f244cc","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimeHeat_REAL","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1110,"y":1040,"wires":[]},{"id":"77506427.f53c1c","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Temperature_SET","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1110,"y":1140,"wires":[]},{"id":"145c01ae.75d7c6","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Humidity_SET","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1100,"y":1340,"wires":[]},{"id":"c466d417.e5db3","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Humidity_REAL","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1100,"y":1440,"wires":[]},{"id":"6986771a.6a4af","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Light_dimmer","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1100,"y":1540,"wires":[]},{"id":"ab194c8f.055528","type":"wirenboard-out","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/error_ch","command":"/on","commandType":"wb_cmd","payload":"payload","payloadType":"msg","x":1080,"y":1640,"wires":[]},{"id":"f714941d.ab9a98","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Fan_switch","outputAtStartup":true,"x":1370,"y":440,"wires":[["b4062cc.f53df5"]]},{"id":"1be4f485.da3e93","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Fan_switch&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":440,"wires":[[]]},{"id":"8f564e76.f7ae7","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":440,"wires":[["1be4f485.da3e93"]]},{"id":"aa5bb49c.ca8088","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/MainPower_switch","outputAtStartup":true,"x":1390,"y":140,"wires":[["bd12281b.9c4e6"]]},{"id":"b66b38d0.d48668","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"Flag","pt":"flow","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":140,"wires":[["a139124c.e2c4c8"]]},{"id":"a139124c.e2c4c8","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=MainPower_switch&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":140,"wires":[[]]},{"id":"bd12281b.9c4e6","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"MainPower_switch","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1590,"y":140,"wires":[["b66b38d0.d48668"]]},{"id":"9379335b.d594e8","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"MainPower_switch","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":160,"wires":[[]]},{"id":"b4062cc.f53df5","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Fan_switch","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1590,"y":440,"wires":[["8f564e76.f7ae7"]]},{"id":"d10d9bc1.60252","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Heat_switch","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":260,"wires":[[]]},{"id":"bf0e0eb1.f4aaa8","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Humidity_switch","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":360,"wires":[[]]},{"id":"41c25204.a804b4","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Fan_switch","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":460,"wires":[[]]},{"id":"6f08dd35.b804b4","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Heat_switch","outputAtStartup":true,"x":1370,"y":240,"wires":[["6777083a.69f388"]]},{"id":"6e73bd25.aab8b4","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Heat_switch&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":240,"wires":[[]]},{"id":"63395fbb.a6d4b","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":240,"wires":[["6e73bd25.aab8b4"]]},{"id":"6777083a.69f388","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Heat_switch","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1590,"y":240,"wires":[["63395fbb.a6d4b"]]},{"id":"e29f61be.7caf18","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Humidity_switch","outputAtStartup":true,"x":1380,"y":340,"wires":[["84a18c67.bcd068"]]},{"id":"1b9d96cf.a7a249","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Humidity_switch&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":340,"wires":[[]]},{"id":"1a1cadea.333b2a","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":340,"wires":[["1b9d96cf.a7a249"]]},{"id":"84a18c67.bcd068","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Humidity_switch","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1590,"y":340,"wires":[["1a1cadea.333b2a"]]},{"id":"cd4e53e2.0703d","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Light_switch","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":560,"wires":[[]]},{"id":"c443709e.553918","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"TimerOffset_checkbox","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":660,"wires":[[]]},{"id":"3a67d73f.391158","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"TimerOffset_time_SET","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":760,"wires":[[]]},{"id":"c7bb7ca1.11dc4","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Light_switch","outputAtStartup":true,"x":1370,"y":540,"wires":[["1da71c61.c2388c"]]},{"id":"6f348350.751d4c","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Light_switch&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":540,"wires":[[]]},{"id":"d4e4769f.093988","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":540,"wires":[["6f348350.751d4c"]]},{"id":"1da71c61.c2388c","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Light_switch","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1590,"y":540,"wires":[["d4e4769f.093988"]]},{"id":"16d7f540.cc6573","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimerOffset_checkbox","outputAtStartup":true,"x":1400,"y":640,"wires":[["25ebeb55.5dda34"]]},{"id":"5017e75a.a4adc8","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=TimerOffset_checkbox&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":640,"wires":[[]]},{"id":"596db1d7.3e714","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":640,"wires":[["5017e75a.a4adc8"]]},{"id":"25ebeb55.5dda34","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"TimerOffset_checkbox","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":640,"wires":[["596db1d7.3e714"]]},{"id":"5fad0ae2.84e02c","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimerOffset_time_SET","outputAtStartup":true,"x":1400,"y":740,"wires":[["d2fc7efd.fe6f08"]]},{"id":"59462b77.d7f71c","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=TimerOffset_time_SET&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":740,"wires":[[]]},{"id":"687d6c2c.43168c","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":740,"wires":[["59462b77.d7f71c"]]},{"id":"d2fc7efd.fe6f08","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"TimerOffset_time_SET","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":740,"wires":[["687d6c2c.43168c"]]},{"id":"f35899f2.856008","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"TimeHeat_SET","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":960,"wires":[[]]},{"id":"64724c6a.5a4334","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Temperature_SET","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":1160,"wires":[[]]},{"id":"d27e565e.263ad8","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/TimeHeat_SET","outputAtStartup":true,"x":1380,"y":940,"wires":[["fbb1ea73.f6962"]]},{"id":"63a9dc19.dfc964","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=TimeHeat_SET&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":940,"wires":[[]]},{"id":"635b18ca.fef86","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":940,"wires":[["63a9dc19.dfc964"]]},{"id":"fbb1ea73.f6962","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"TimeHeat_SET","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":940,"wires":[["635b18ca.fef86"]]},{"id":"ec3da26a.4dbba8","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Temperature_SET","outputAtStartup":true,"x":1390,"y":1140,"wires":[["63241b9c.355514"]]},{"id":"a55f2995.b86c8","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Temperature_SET&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":1140,"wires":[[]]},{"id":"42d8ea27.e65984","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":1140,"wires":[["a55f2995.b86c8"]]},{"id":"63241b9c.355514","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Temperature_SET","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":1140,"wires":[["42d8ea27.e65984"]]},{"id":"746426bd.3d2378","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Humidity_SET","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":1360,"wires":[[]]},{"id":"ca7d4794.695f28","type":"change","z":"8e15de5c.404018","name":"","rules":[{"t":"set","p":"Light_dimmer","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":1560,"wires":[[]]},{"id":"15e7159.f303b6a","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Humidity_SET","outputAtStartup":true,"x":1380,"y":1340,"wires":[["b311dcbc.5fa9b8"]]},{"id":"d7d532b9.a93d18","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Humidity_SET&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":1340,"wires":[[]]},{"id":"2e2c9d61.8bb14a","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":1340,"wires":[["d7d532b9.a93d18"]]},{"id":"b311dcbc.5fa9b8","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Humidity_SET","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":1340,"wires":[["2e2c9d61.8bb14a"]]},{"id":"3449e51c.4692fa","type":"wirenboard-in","z":"8e15de5c.404018","name":"","server":"8da09053.5bb7e","channel":"/devices/sauna/controls/Light_dimmer","outputAtStartup":true,"x":1370,"y":1540,"wires":[["e585f3f0.1e3f4"]]},{"id":"df126bbc.2b4028","type":"http request","z":"8e15de5c.404018","name":"Запрос записи сауны","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.200.24/set/m2m/outputs?type=specific&number=0&sp_name=Light_dimmer&value={{value}}&hash=d033e22ae348aeb5660fc2140aec35850c4da997","tls":"","persist":false,"proxy":"","authType":"","x":1960,"y":1540,"wires":[[]]},{"id":"e1a4996f.19ffe8","type":"change","z":"8e15de5c.404018","name":"Set output","rules":[{"t":"set","p":"value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":1540,"wires":[["df126bbc.2b4028"]]},{"id":"e585f3f0.1e3f4","type":"switch","z":"8e15de5c.404018","name":"Изменился?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Light_dimmer","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1610,"y":1540,"wires":[["e1a4996f.19ffe8"]]},{"id":"8da09053.5bb7e","type":"wirenboard-server","z":"","name":"Wirenboard 6 Nevoton","host":"192.168.200.70","mqtt_port":"1883","mqtt_username":"","mqtt_password":""}]
Бродкин Константин Владимирович
https://sprut.ai/client/pastes/c4tP8VJg
Скрипт виртуального устройства Sauna.js
// Задание параметров сауны на панели Devices defineVirtualDevice("sauna", { title: "Smart Sauna", cells: { MainPower_switch: { type: "switch", order: 1, value: false }, Heat_switch: { type: "switch", order: 2, value: false }, Humidity_switch: { type: "switch", value: false, order: 3 }, Fan_switch: { type: "switch", value: false, order: 4 }, Light_switch: { type: "switch", value: false, order: 5 }, TimerOffset_checkbox: { type: "switch", value: false, order: 6 }, TimerOffset_time_SET: { type: "range", value: 720 , max : 720, order: 7 }, TimerOffset_time_REAL: { type : "value", value: 0, order: 8 }, TimeHeat_SET: { type: "range", value: 360 , max : 360, order: 9 }, TimeHeat_REAL: { type : "value", value: 0, order: 10 }, Temperature_SET: { type: "range", value: 90 , max : 120, order: 11 }, Temperature_REAL: { type : "temperature", value: 0, order: 12 }, Humidity_SET: { type: "range", value: 30 , max : 100, order: 13 }, Humidity_REAL: { type : "value", value: 0, order: 14 }, Light_dimmer: { type: "range", value: 3 , max : 6, order: 15 }, error_ch: { type : "value", value: 0, order: 16 } } });
«
1
2
3
4
5
»