Статья

Автоматизация проветривания комнаты (Drivent, датчик СО2, датчик температуры, скорость и направление ветра). Home Assistant + Node Red.

Установка Drivent'а

Это уникальное устройство, аналогов которому очень мало. Устанавливается на створку окна и может управлять проветриванием в вертикальном или горизонтальном положении открытия. У ребят есть телеграм канал, где можно все узнать и приобрести.

Установка оказалась довольно простой. Вместе с приводом приходит ссылка на электронную инструкцию и весь необходимый крепеж. Комплект сделан очень приятно и аккуратно упакован, есть и ключ для фиксации тяги, и сверлышко, и даже запасные части. Расположил по центру сверху створки, для использования только в режиме проветривания с вертикальным открытием. Просверлил два отверстия под винты крепления и одно сквозное под углом, чтобы протянуть кабель питания таким образом, чтобы он выходил между двумя уплотнителями (внешним и внутренним), исключая прямое сообщение воздуха помещения с улицей.

(Сорри за вертикальное видео, оно было снято для телеграма).

Далее просто проложил кабель вдоль створки, используя пару специальных заглушек для профиля из комплекта, в самом низу и вывел его у нижней петли. Розетка у меня находится прям под подоконником, поэтому дальше проблем не возникло. Кабель нигде ни за что не цепляется, окно открывается и закрывается без проблем. Многие предлагают использовать супер-клей (гель) для фиксации провода в углу профиля, я не стал.

Интеграция в умный дом

Drivent легко интегрируется в умный дом Алисы, Homekit, Home Assistant, Node Red. Первоначальной настройкой подключаем его в свою сеть wi-fi, после чего для Home Assistant указываем ip и порт своего MQTT Server'а, по итогу появляются сущности и сенсоры. Дальше я настроил параметры "защиты". Это параметр, который отвечает за остановку двигателя из-за возросшей нагрузки. У всех окна разного размера и требуется разное усилие для открытия/закрытия. Защита поможет спасти привод от перегрузок, если происходит защемление какого-то предмета или же, допустим, вы забыли открыть ручку створки. Также есть 4 скорости работы: 25%, 50%, 75% и 100%. Чем выше скорость, тем больше шума, но и мощность тоже выше. Для каждой скорости в последней прошивке можно установить свой параметр защиты. Я остановился на 50% скорости открытия, привод практически не слышно и отрабатывает довольно быстро, на видео выше именно 50%. Чтобы появился слайдер я использовал: https://github.com/thomasloven/lovelace-slider-entity-row, правда он округляет до 5%.

В качестве сервера умного дома у меня используется Raspberry Pi 3B с установленным на ней Home Assistant, однако для автоматизаций в Home Assistant я использую интегрированный Node-Red т.к. не люблю писать много текста в yaml. Таких как я мало, обычно используют или yaml/ui или чистый Node-Red, но это мой выбор и мне он нравится. В HA прекрасно залетают все необходимые устройства, Dashboard легко настраивается, а в Node-Red очень понятно и наглядно делать автоматизации и исправлять их.

Автоматизация

Я изначально хотел добиться того, чтобы перестать вручную открывать/закрывать окно для проветривания, поэтому тупое пробрасывание Drivent в умный дом меня не устраивало, люблю, когда все делает умный дом сам, без моего участия. Моя автоматизация уже прошла много ревизий и на данный момент для ее работы я использую:

  • датчик температуры в комнате

- platform: min_max name: mean_temperature type: mean entity_ids: - sensor.temperature1 - sensor.temperature2

Я нашел место для одного датчика, показания которого меня устраивают.

  • датчик СО2
  • сенсор скорости ветра
  • сенсор направления ветра

Ветер очень сильно влияет при открытой створке на температуру в комнате: во-первых, она очень быстро меняется, а если еще ветер с порывами, то и хаотично, а во-вторых, может создавать сквозняки, но это лишь в том случае, если ветер направлен в окно, т.е. создается избыточное давление снаружи. Если ветер дует с противоположной стороны здания, то за окном создается отрицательное давление и даже при высокой скорости ветра, этот параметр слабо влияет на изменение температуры в комнате. Необходимый сектор, который нужно учитывать в автоматизации, легко определить по расположению вашего дома и этой картинки:

Я взял сектор 0-90о. Если дует из этого сектора, то окно открывается меньше, если в этот сектор не попадает, то параметр скорость ветра не учитывается. Итак, сама автоматизация выглядит так:

  1. Считывается датчик температуры - не чаще 1 раза в 5 минут (чтобы привод постоянно не двигался).
  2. Проверяется, не включен ли ручной режим с отдельной кнопки или голосом через Алису (об этом ниже).
  3. У меня есть дневной режим и ночной, ночной выставляет температуру на 1 градус ниже (мы любим спать, когда попрохладнее).
  4. Температура делится на 6 выходов >23.5о; 23.5о-23о; 23о-22.6о; 22.6о-22.3о; 22.3о-22о; <22о было подобрано на практике как комфортная.
  5. Считывается сенсор скорости ветра и направления.
  6. Направление ветра делится на 0-90 и >90. Если больше 90, скорость не учитывается и автоматизация уходит на датчик СО2. Если меньше 90, то делится по скорости ветра 0-3.5; 3.5-5.5;>5.5 (и отдельный выход "иначе", если сенсор не считается из-за ошибки интеграции).
  7. Датчик СО2 делится на >800 и <800.
  8. Открытие окна: закрыто, 12%, 25%, 50%, 75%, 100%.
  9. Остальное можно проследить по соединительным линиям.

Пример с использованием 4-клавишным переключателем сцен Tuya для ручного управления. Используется нажатия типа Single, Double, Hold.

  • При одинарном нажатии включается ручной режим, окно закрывается, Алиса сообщает, что включен ручной режим и окно закрыто. Каждое последующее нажатие открывает окно на ступень с шагом 25%. Через 2 минуты счетчик сбрасывается для того, чтобы дальнейшее первое нажатие закрывало окно.
  • При двойном нажатии включается автоматический режим, окно закрывается и Алиса сообщает: "Включен автоматический режим, окно закрыто".
  • При удержании кнопки включается ручной "режим проветривания" с открытием на 100% на 5 минут, Алиса об этом сообщает. Через 5 минут включается автоматический режим обратно.

И последний вариант управления - через Алису. Я использовал интеграцию AlexxIT Yandex.Station. Просто говорим: "Алиса, закрой окно", после чего окно закрывается. Алиса отвечает: "Окно закрыто, включен ручной режим на 3 часа". Для этого необходимо установить интеграцию, в Умном доме Яндекса сделать сценарий:

а в Node Red выловить этот event:

На данный момент автоматизация работает хорошо. Она довольно проста, и ее легко подогнать под себя. Готов выслушать обоснованную критику и предложения модернизации.

Флоу с кнопкой:

[{"id":"144f79d7c91832e1","type":"tab","label":"Поток 2","disabled":false,"info":""},{"id":"6800a566873599c0","type":"switch","z":"144f79d7c91832e1","name":"как нажали кнопку?","property":"data.old_state.state","propertyType":"msg","rules":[{"t":"eq","v":"1_single","vt":"str"},{"t":"eq","v":"1_double","vt":"str"},{"t":"eq","v":"1_hold","vt":"str"},{"t":"eq","v":"2_single","vt":"str"},{"t":"eq","v":"2_double","vt":"str"},{"t":"eq","v":"2_hold","vt":"str"},{"t":"eq","v":"3_single","vt":"str"},{"t":"eq","v":"3_double","vt":"str"},{"t":"eq","v":"3_hold","vt":"str"},{"t":"eq","v":"4_single","vt":"str"},{"t":"eq","v":"4_double","vt":"str"},{"t":"eq","v":"4_hold","vt":"str"}],"checkall":"false","repair":false,"outputs":12,"x":340,"y":320,"wires":[[],[],[],["c3852e9f31dfdf60"],["82f14b0ce6cf7eaf"],["ac64ac48546a4722"],[],[],[],[],[],[]]},{"id":"d93409796d529e18","type":"server-state-changed","z":"144f79d7c91832e1","name":"кнопка 4х кл.","server":"a5b971b7.6d6e3","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.0x5c0272fffedc32c6_action","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":90,"y":260,"wires":[["713de763306b4293"]]},{"id":"ab27e69db2cad241","type":"comment","z":"144f79d7c91832e1","name":"4х клавишная кнопка Zigbee","info":"","x":720,"y":80,"wires":[]},{"id":"c3852e9f31dfdf60","type":"change","z":"144f79d7c91832e1","name":"drivent manual","rules":[{"t":"set","p":"drivent","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":240,"wires":[["09290277439ca787","e23f754a16ae6999"]]},{"id":"82f14b0ce6cf7eaf","type":"change","z":"144f79d7c91832e1","name":"drivent auto","rules":[{"t":"set","p":"drivent","pt":"global","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":300,"wires":[["31a7d01288c2a3d7"]]},{"id":"056c41372f1953d4","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 25%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":25}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":160,"wires":[[]]},{"id":"01b9ba556ae8dc08","type":"switch","z":"144f79d7c91832e1","name":"0-100%","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"eq","v":"6","vt":"num"}],"checkall":"true","repair":false,"outputs":6,"x":1000,"y":240,"wires":[["fb7067f62b093a6e"],["056c41372f1953d4"],["f11332b1e642d60e"],["ae70904308b387a2"],["38641eb3df1dfebf"],["7e817c65eea2bbfa"]]},{"id":"f11332b1e642d60e","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 50%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":50}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":200,"wires":[[]]},{"id":"ae70904308b387a2","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 75%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":75}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":240,"wires":[[]]},{"id":"38641eb3df1dfebf","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 100%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":100}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":280,"wires":[[]]},{"id":"fb7067f62b093a6e","type":"api-call-service","z":"144f79d7c91832e1","name":"окно закрыто","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":0}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1220,"y":120,"wires":[["843e2a2f2e7b3690"]]},{"id":"31a7d01288c2a3d7","type":"api-call-service","z":"144f79d7c91832e1","name":"окно закрыто","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":0}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":720,"y":300,"wires":[["6e09609995550d35"]]},{"id":"7e817c65eea2bbfa","type":"function","z":"144f79d7c91832e1","name":"Reset Counter","func":"msg.reset = true;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":180,"wires":[["09290277439ca787"]]},{"id":"09290277439ca787","type":"counter","z":"144f79d7c91832e1","name":"","init":"1","step":1,"lower":"1","upper":"6","mode":"increment","outputs":2,"x":780,"y":140,"wires":[["01b9ba556ae8dc08"],[]]},{"id":"713de763306b4293","type":"delay","z":"144f79d7c91832e1","name":"1 msg/1s","pauseType":"queue","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"x":140,"y":360,"wires":[["6800a566873599c0"]]},{"id":"ac64ac48546a4722","type":"change","z":"144f79d7c91832e1","name":"drivent manual","rules":[{"t":"set","p":"drivent","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":380,"wires":[["d1103e932f139436"]]},{"id":"d1103e932f139436","type":"api-call-service","z":"144f79d7c91832e1","name":"окно открыто","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":100}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":740,"y":380,"wires":[["cbec6b3da18a8068","964cc9c9286c4e8c"]]},{"id":"cbec6b3da18a8068","type":"trigger","z":"144f79d7c91832e1","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":980,"y":400,"wires":[["e5d0e1406af1b541"]]},{"id":"e5d0e1406af1b541","type":"change","z":"144f79d7c91832e1","name":"drivent auto","rules":[{"t":"set","p":"drivent","pt":"global","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":400,"wires":[[]]},{"id":"2415a124994201cc","type":"inject","z":"144f79d7c91832e1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":980,"y":440,"wires":[["e5d0e1406af1b541"]]},{"id":"964cc9c9286c4e8c","type":"change","z":"144f79d7c91832e1","name":"проветривание","rules":[{"t":"set","p":"payload","pt":"msg","to":"Включаю режим проветривания в спальне на 5 минут","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":360,"wires":[["b71645d442b166b3"]]},{"id":"843e2a2f2e7b3690","type":"change","z":"144f79d7c91832e1","name":"окно закрыто","rules":[{"t":"set","p":"payload","pt":"msg","to":"Окно закрыто. Включён ручной режим.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":120,"wires":[["3fbcd5a4a164c6a5"]]},{"id":"3fbcd5a4a164c6a5","type":"alice-send","z":"144f79d7c91832e1","name":"сказать","login":"","command_type":"tts","x":1480,"y":180,"wires":[[]]},{"id":"6e09609995550d35","type":"change","z":"144f79d7c91832e1","name":"окно закрыто. auto","rules":[{"t":"set","p":"payload","pt":"msg","to":"Окно закрыто. Включён автоматический режим.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":320,"wires":[["b71645d442b166b3"]]},{"id":"e23f754a16ae6999","type":"trigger","z":"144f79d7c91832e1","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"120","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":240,"wires":[["7e817c65eea2bbfa"]]},{"id":"dec6d4817f3efd61","type":"link in","z":"144f79d7c91832e1","name":"","links":["b71645d442b166b3"],"x":1355,"y":180,"wires":[["3fbcd5a4a164c6a5"]]},{"id":"b71645d442b166b3","type":"link out","z":"144f79d7c91832e1","name":"","links":["dec6d4817f3efd61"],"x":1155,"y":340,"wires":[]},{"id":"a5b971b7.6d6e3","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Флоу с Алисой:

[{"id":"ec88b9ea.30dc78","type":"tab","label":"Поток 1","disabled":false,"info":""},{"id":"97a1ca77494b5f55","type":"server-events","z":"ec88b9ea.30dc78","name":"","server":"a5b971b7.6d6e3","version":1,"event_type":"yandex_speaker","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":150,"y":380,"wires":[["c24580e7b8a78f82"]]},{"id":"c24580e7b8a78f82","type":"switch","z":"ec88b9ea.30dc78","name":"","property":"payload.event.value","propertyType":"msg","rules":[{"t":"eq","v":"окно закрыто, включен ручной режим на 3 часа","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":380,"wires":[["7f095b71dc63b08d"]]},{"id":"7f095b71dc63b08d","type":"change","z":"ec88b9ea.30dc78","name":"drivent manual","rules":[{"t":"set","p":"drivent","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":380,"wires":[["9653ddaa29e6a3d6"]]},{"id":"9653ddaa29e6a3d6","type":"api-call-service","z":"ec88b9ea.30dc78","name":"окно закрыто","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":0}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":380,"wires":[["8d37dece35d3e019"]]},{"id":"8d37dece35d3e019","type":"trigger","z":"ec88b9ea.30dc78","name":"3hr","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"hr","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":850,"y":380,"wires":[["29354a770c8033c2"]]},{"id":"29354a770c8033c2","type":"change","z":"ec88b9ea.30dc78","name":"drivent auto","rules":[{"t":"set","p":"drivent","pt":"global","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":380,"wires":[[]]},{"id":"a5b971b7.6d6e3","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Основное флоу автоматизации:

[{"id":"144f79d7c91832e1","type":"tab","label":"Поток 2","disabled":false,"info":""},{"id":"362586ea625776fe","type":"comment","z":"144f79d7c91832e1","name":"Drivent","info":"","x":770,"y":360,"wires":[]},{"id":"43c5629c4a0ec49b","type":"server-state-changed","z":"144f79d7c91832e1","name":"t","server":"a5b971b7.6d6e3","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.0x00158d0000da9eb4_temperature","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"15","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":430,"y":460,"wires":[["83a33307f8b70430"],[]]},{"id":"44e4c6eb7c0f0bbb","type":"switch","z":"144f79d7c91832e1","name":"проверка ручного режима","property":"drivent","propertyType":"global","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":820,"y":420,"wires":[["241412e46c0759ec"]],"icon":"node-red/arrow-in.svg"},{"id":"83a33307f8b70430","type":"delay","z":"144f79d7c91832e1","name":"1 msg/5min","pauseType":"rate","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"x":590,"y":460,"wires":[["44e4c6eb7c0f0bbb"]]},{"id":"241412e46c0759ec","type":"time-range-switch","z":"144f79d7c91832e1","name":"","lat":"","lon":"","startTime":"23:00","endTime":"07:00","startOffset":0,"endOffset":0,"x":490,"y":540,"wires":[["5d5666c2035432e2"],["fa3297ae598e7d7a"]]},{"id":"f6495a1f05288d01","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 75%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":75}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1610,"y":660,"wires":[[]]},{"id":"5d5666c2035432e2","type":"switch","z":"144f79d7c91832e1","name":"23.5-22 / 22.5-21","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"23.5","vt":"num"},{"t":"btwn","v":"23.5","vt":"num","v2":"23","v2t":"num"},{"t":"btwn","v":"23","vt":"num","v2":"22.6","v2t":"num"},{"t":"btwn","v":"22.6","vt":"num","v2":"22.3","v2t":"num"},{"t":"btwn","v":"22.3","vt":"num","v2":"22","v2t":"num"},{"t":"lt","v":"22","vt":"num"}],"checkall":"false","repair":false,"outputs":6,"x":530,"y":780,"wires":[["c043d6be7449dd74"],["6f5e504f09af8f69"],["2f570b5001c922e1"],["f7fdbd9b7346988a"],["6edda9623a232360"],["af03fcb8db5ca310","eb43954c29e4b521"]]},{"id":"d118827a9243a07f","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 100%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":100}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1610,"y":500,"wires":[[]]},{"id":"e033e6a2dd22ad98","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 50%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":50}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1610,"y":760,"wires":[[]]},{"id":"af8adee29414cf27","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 25%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":25}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1610,"y":860,"wires":[[]]},{"id":"8d2f65b215627015","type":"api-call-service","z":"144f79d7c91832e1","name":"окно закрыто","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":0}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1620,"y":1080,"wires":[[]]},{"id":"d822b490b0842cdf","type":"api-current-state","z":"144f79d7c91832e1","name":"Датчик CO2","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"350","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.0x00124b00234c8c0e_co2_1_co2","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1250,"y":600,"wires":[["90474bb585d6ded6"],[]]},{"id":"90474bb585d6ded6","type":"switch","z":"144f79d7c91832e1","name":"co2","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"800","vt":"num"},{"t":"lt","v":"800","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1390,"y":600,"wires":[["d118827a9243a07f"],["f6495a1f05288d01"]]},{"id":"25f8d78d5f483b66","type":"switch","z":"144f79d7c91832e1","name":"co2","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"800","vt":"num"},{"t":"lt","v":"800","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1390,"y":700,"wires":[["f6495a1f05288d01"],["e033e6a2dd22ad98"]]},{"id":"43b2bc7b3ecb17b0","type":"api-current-state","z":"144f79d7c91832e1","name":"Датчик CO2","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"350","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.0x00124b00234c8c0e_co2_1_co2","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1250,"y":700,"wires":[["25f8d78d5f483b66"],[]]},{"id":"54025f88bcd7da5e","type":"api-current-state","z":"144f79d7c91832e1","name":"Датчик CO2","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"350","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.0x00124b00234c8c0e_co2_1_co2","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1250,"y":800,"wires":[["245c7f08807df79d"],[]]},{"id":"245c7f08807df79d","type":"switch","z":"144f79d7c91832e1","name":"co2","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"800","vt":"num"},{"t":"lt","v":"800","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1390,"y":800,"wires":[["e033e6a2dd22ad98"],["af8adee29414cf27"]]},{"id":"af03fcb8db5ca310","type":"api-current-state","z":"144f79d7c91832e1","name":"Датчик CO2","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"350","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.0x00124b00234c8c0e_co2_1_co2","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1250,"y":1000,"wires":[["6a5d4f325f2ebdf7"],[]]},{"id":"6a5d4f325f2ebdf7","type":"switch","z":"144f79d7c91832e1","name":"co2","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"800","vt":"num"},{"t":"lt","v":"800","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1390,"y":1000,"wires":[["97493d2fdbce6798"],["8d2f65b215627015"]]},{"id":"97493d2fdbce6798","type":"api-call-service","z":"144f79d7c91832e1","name":"окно 12%","server":"a5b971b7.6d6e3","version":3,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.drivent_e7a","data":"{\"position\":12}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1610,"y":960,"wires":[[]]},{"id":"3ddc91bf9c8cf724","type":"api-current-state","z":"144f79d7c91832e1","name":"Датчик CO2","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"350","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.0x00124b00234c8c0e_co2_1_co2","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1250,"y":900,"wires":[["f5a44256cc9a099b"],[]]},{"id":"f5a44256cc9a099b","type":"switch","z":"144f79d7c91832e1","name":"co2","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"800","vt":"num"},{"t":"lt","v":"800","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1390,"y":900,"wires":[["af8adee29414cf27"],["97493d2fdbce6798"]]},{"id":"c043d6be7449dd74","type":"api-current-state","z":"144f79d7c91832e1","name":"Ветер","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_speed","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":520,"wires":[["b9557908f28cb8c4"],[]]},{"id":"4976b3c29e4d0712","type":"switch","z":"144f79d7c91832e1","name":"ветер","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"3.5","v2t":"num"},{"t":"btwn","v":"3.5","vt":"num","v2":"5.5","v2t":"num"},{"t":"gt","v":"5.5","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":1390,"y":540,"wires":[["d118827a9243a07f"],["e033e6a2dd22ad98"],["97493d2fdbce6798"],["d118827a9243a07f"]]},{"id":"1eea531d9fc74205","type":"switch","z":"144f79d7c91832e1","name":"ветер","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"3.5","v2t":"num"},{"t":"btwn","v":"3.5","vt":"num","v2":"5.5","v2t":"num"},{"t":"gt","v":"5.5","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":1010,"y":620,"wires":[["d822b490b0842cdf"],["54025f88bcd7da5e"],["af03fcb8db5ca310"],["d822b490b0842cdf"]]},{"id":"6f5e504f09af8f69","type":"api-current-state","z":"144f79d7c91832e1","name":"Ветер","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_speed","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":580,"wires":[["36237dc2a32bdbd9"],[]]},{"id":"2f570b5001c922e1","type":"api-current-state","z":"144f79d7c91832e1","name":"Ветер","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_speed","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":700,"wires":[["161c4db9781068d9"],[]]},{"id":"b3f9403bac915ea9","type":"switch","z":"144f79d7c91832e1","name":"ветер","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"3.5","v2t":"num"},{"t":"btwn","v":"3.5","vt":"num","v2":"5.5","v2t":"num"},{"t":"gt","v":"5.5","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":1010,"y":720,"wires":[["43b2bc7b3ecb17b0"],["3ddc91bf9c8cf724"],["af03fcb8db5ca310"],["43b2bc7b3ecb17b0"]]},{"id":"865b96f92c94226c","type":"switch","z":"144f79d7c91832e1","name":"ветер","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"3.5","v2t":"num"},{"t":"btwn","v":"3.5","vt":"num","v2":"5.5","v2t":"num"},{"t":"gt","v":"5.5","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":1010,"y":820,"wires":[["54025f88bcd7da5e"],["3ddc91bf9c8cf724"],["af03fcb8db5ca310"],["54025f88bcd7da5e"]]},{"id":"f7fdbd9b7346988a","type":"api-current-state","z":"144f79d7c91832e1","name":"Ветер","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_speed","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":800,"wires":[["2330d472c5fbbf77"],[]]},{"id":"6edda9623a232360","type":"api-current-state","z":"144f79d7c91832e1","name":"Ветер","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_speed","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":900,"wires":[["a2942a10db632247"],[]]},{"id":"ac320d80754bc61c","type":"switch","z":"144f79d7c91832e1","name":"ветер","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"3.5","v2t":"num"},{"t":"btwn","v":"3.5","vt":"num","v2":"5.5","v2t":"num"},{"t":"gt","v":"5.5","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":1010,"y":920,"wires":[["3ddc91bf9c8cf724"],["af03fcb8db5ca310"],["8d2f65b215627015"],["3ddc91bf9c8cf724"]]},{"id":"eb43954c29e4b521","type":"api-current-state","z":"144f79d7c91832e1","name":"Ветер","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_speed","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":980,"wires":[["5d0be524635d59ac"],[]]},{"id":"dc87146e72b3e12b","type":"switch","z":"144f79d7c91832e1","name":"ветер","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"3.5","v2t":"num"},{"t":"btwn","v":"3.5","vt":"num","v2":"5.5","v2t":"num"},{"t":"gt","v":"5.5","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":1010,"y":1020,"wires":[["af03fcb8db5ca310"],["8d2f65b215627015"],["8d2f65b215627015"],["af03fcb8db5ca310"]]},{"id":"fa3297ae598e7d7a","type":"function","z":"144f79d7c91832e1","name":"t-1","func":"msg.payload = Number((msg.payload -1));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":620,"wires":[["5d5666c2035432e2"]]},{"id":"b9557908f28cb8c4","type":"api-current-state","z":"144f79d7c91832e1","name":"Напр","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"90","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_bearing","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":500,"wires":[["d118827a9243a07f"],["4976b3c29e4d0712"]]},{"id":"36237dc2a32bdbd9","type":"api-current-state","z":"144f79d7c91832e1","name":"Напр","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"90","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_bearing","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":580,"wires":[["d822b490b0842cdf"],["1eea531d9fc74205"]]},{"id":"161c4db9781068d9","type":"api-current-state","z":"144f79d7c91832e1","name":"Напр","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"90","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_bearing","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":680,"wires":[["43b2bc7b3ecb17b0"],["b3f9403bac915ea9"]]},{"id":"2330d472c5fbbf77","type":"api-current-state","z":"144f79d7c91832e1","name":"Напр","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"90","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_bearing","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":780,"wires":[["54025f88bcd7da5e"],["865b96f92c94226c"]]},{"id":"a2942a10db632247","type":"api-current-state","z":"144f79d7c91832e1","name":"Напр","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"90","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_bearing","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":880,"wires":[["3ddc91bf9c8cf724"],["ac320d80754bc61c"]]},{"id":"5d0be524635d59ac","type":"api-current-state","z":"144f79d7c91832e1","name":"Напр","server":"a5b971b7.6d6e3","version":2,"outputs":2,"halt_if":"90","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.openweathermap_wind_bearing","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":870,"y":980,"wires":[["af03fcb8db5ca310"],["dc87146e72b3e12b"]]},{"id":"a5b971b7.6d6e3","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]


Статья огонь! а почему не откажешься от Home Assistant в пользу чисто Node Red?

В ХА легко залетают практически все устройства и легко делается дешбоард, да в целом ХА понятней мне.

Класс!! 

ПC: Скорости 4, а не 3) 25%, 50%, 75%, 100%

Сейчас попросим модераторов подправить

Да, верно. Нужно поправить. Спасибо.

Отличная работа! Хочу немного поправить - в приводе 4 скорости: 25, 50, 75 и 100. 

Отличная работа! 

Спасибо ;)

Очень интересная статья! Тоже сейчас обдумываю вариант установки привода на окно. Только не могу определиться между этим девайсом и аналогом от tuya 

Скажите модель от tuya?

Это цепной, у него другая механика, он большого размера и не очень эстетично выглядит. Цепной подходит для теплиц, может широко открыть створку и пофик на дизайн.

Отлично, познавательно. Допишу все же свою статью, хотя наверно читателям уже будет не так интересно😀

Интересно) в любом случае одинаковых не получится!

Всегда интересно, у многих автоматизации совсем иначе работают, каждый делает под себя. У Андрея Зубикова еще интересный вариант для HA.

Сначала так же использовал "ступенчатый" режим работы, потом понял, что он неудобен. Очень большая инертность (гистерезис). Переделал на "пропорциональный" режим - чем больше дельта между нормой СО2 и текущими показаниями - тем на большее значение открывается окно.

Еще ломаю голову, как автоматом ловить сквозняки. Они не всегда бывают только тогда, когда "встречный" ветер. В высотках с перепадом давления частно также связано может быть.



https://sprut.ai/static/media/cache/00/70/19/5/10378028/82957/1000x_image.jpg?1635194966" alt="1000x_image.jpg?1635194966" />
https://sprut.ai/static/media/cache/00/70/19/5/10378028/82958/1000x_image.jpg?1635194986" alt="1000x_image.jpg?1635194986" />
https://sprut.ai/static/media/cache/00/70/19/5/10378028/82959/1000x_image.jpg?1635195000" alt="1000x_image.jpg?1635195000" />

Меня вполне устраивает как работает, ведь ступенчатый режим у меня может и через ступени прыгать без проблем, в конце графика видно как он открылся на ночной режим, чтобы понизить температуру на градус в комнате.

Какой использовали датчик скорости ветра?
Это прогноз. Интеграция openweathermap
Не хватает только проверки из того же (а лучше даже нескольких) прогнозов погоды, либо вообще датчика на улице на наличие дождя на улице, чтобы не открывать окно

Вернуться назад

Устройства


Вернуться назад