Olá nuno!! Muito obrigado!!
Eu depois explorei melhor, consegui fazer isto
E já fiz a parte do controlo no node-red, já se encontra operacional.
Como meti no configuration.yaml. O meu estoro tem o tasmota como shutter.
input_boolean:
automatico_estoro:
name: Automático
#icon: mdi:car
icon: mdi:white-balance-sunny
abrir_estoro_tempo_bool:
name: Hora de abrir acionada
icon: mdi:toggle-switch-outline
fechar_estoro_tempo_bool:
name: Hora de fechar acionada
icon: mdi:toggle-switch-outline
input_datetime:
hours_abrir_estoro:
name: Hora de abrir o estoro
has_date: false
has_time: true
hours_fechar_estoro:
name: Hora de fechar o estoro
has_date: false
has_time: true
cover:
- platform: mqtt
name: "Estoro Quarto"
availability_topic: "tele/iestoro/LWT"
payload_available: "Online"
payload_not_available: "Offline"
position_topic: "stat/iestoro/RESULT"
value_template: >
{% if ('Shutter1' in value_json) and ('Position' in value_json.Shutter1) %}
{{ value_json.Shutter1.Position }}
{% else %}
{% if is_state('cover.estoro_quarto', 'unknown') %}
50
{% else %}
{{ state_attr('cover.estoro_quarto','current_position') }}
{% endif %}
{% endif %}
position_open: 100
position_closed: 0
set_position_topic: "cmnd/iestoro/ShutterPosition1"
command_topic: "cmnd/iestoro/Backlog"
payload_open: "ShutterOpen1"
payload_close: "ShutterClose1"
payload_stop: "ShutterStop1"
retain: false
optimistic: false
qos: 1
E se alguém quiser este é o meu node-red:
[{"id":"8f07cb.68578838","type":"tab","label":"Estoro Final","disabled":false,"info":""},{"id":"3ee406fe.f4463a","type":"mqtt out","z":"8f07cb.68578838","name":"MQTT Estoro Quarto","topic":"cmnd/iestoro/Backlog","qos":"2","retain":"","broker":"967bd4ec.441b58","x":260,"y":520,"wires":[]},{"id":"ccdb2d10.0cda7","type":"link in","z":"8f07cb.68578838","name":"","links":["f5f5658e.6faf18","4ed87204.04651c","25c0e0c8.4070d","5b4523eb.ddcd7c"],"x":95,"y":520,"wires":[["3ee406fe.f4463a"]]},{"id":"6ed2fbfd.c13774","type":"server-state-changed","z":"8f07cb.68578838","name":"Horas Abrir Estoro","server":"7b917f5b.7abab","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_datetime.hours_abrir_estoro","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":220,"wires":[["16c9e17b.29f4cf"]]},{"id":"f5f5658e.6faf18","type":"link out","z":"8f07cb.68578838","name":"Estoro Quarto","links":["ccdb2d10.0cda7"],"x":1315,"y":240,"wires":[]},{"id":"de570282.4380b","type":"schedex","z":"8f07cb.68578838","name":"estoro clock","passthroughunhandled":false,"suspended":false,"lat":"41.533894","lon":"-8.500357","ontime":"07:00","ontopic":"","onpayload":"open","onoffset":0,"onrandomoffset":0,"offtime":"07:01","offtopic":"","offpayload":"close","offoffset":"","offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":550,"y":240,"wires":[["d5e81edb.380f"]]},{"id":"16c9e17b.29f4cf","type":"function","z":"8f07cb.68578838","name":"set time","func":"varAlarmTime = msg.payload;\nmsg.payload = {};\nmsg.payload.ontime = varAlarmTime\n//msg.payload.offtime = varAlarmTime\n//msg.payload.offoffset = 1\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":220,"wires":[["de570282.4380b"]]},{"id":"d63b7f61.9f5a2","type":"server-state-changed","z":"8f07cb.68578838","name":"Horas Fechar Estoro","server":"7b917f5b.7abab","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_datetime.hours_fechar_estoro","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":280,"wires":[["fa8ecf53.5da45"]]},{"id":"fa8ecf53.5da45","type":"function","z":"8f07cb.68578838","name":"set time","func":"varAlarmTime = msg.payload;\nmsg.payload = {};\n//msg.payload.ontime = varAlarmTime\nmsg.payload.offtime = varAlarmTime\n//msg.payload.offoffset = 1\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":280,"wires":[["de570282.4380b"]]},{"id":"711fda37.833924","type":"api-current-state","z":"8f07cb.68578838","name":"Fechar estoro enable","server":"7b917f5b.7abab","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.fechar_estoro_tempo_bool","state_type":"habool","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":940,"y":280,"wires":[["84ff129a.3462c"],[]]},{"id":"5400c6b7.fce428","type":"api-current-state","z":"8f07cb.68578838","name":"Abrir estoro enable","server":"7b917f5b.7abab","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.abrir_estoro_tempo_bool","state_type":"habool","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":930,"y":220,"wires":[["84eb4b25.a81fc8"],[]]},{"id":"d5e81edb.380f","type":"switch","z":"8f07cb.68578838","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"close","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":730,"y":240,"wires":[["5400c6b7.fce428"],["711fda37.833924"]]},{"id":"84ff129a.3462c","type":"trigger","z":"8f07cb.68578838","op1":"ShutterClose1","op2":"","op1type":"str","op2type":"nul","duration":"250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Fechar Estoro","x":1160,"y":280,"wires":[["f5f5658e.6faf18"]]},{"id":"84eb4b25.a81fc8","type":"trigger","z":"8f07cb.68578838","op1":"ShutterOpen1","op2":"","op1type":"str","op2type":"nul","duration":"250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Fechar Estoro","x":1160,"y":220,"wires":[["f5f5658e.6faf18"]]},{"id":"87796be3.b9aaf8","type":"function","z":"8f07cb.68578838","name":"extract body","func":"\nreturn {\n payload: msg.payload.body\n};","outputs":1,"noerr":0,"x":350,"y":400,"wires":[["fc2ba1a3.86787"]]},{"id":"aa938e97.3aa35","type":"switch","z":"8f07cb.68578838","name":"","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"O","vt":"str"},{"t":"eq","v":"C","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":400,"wires":[["a0717691.c2ae28"],["7e219595.f90a2c"]]},{"id":"fc2ba1a3.86787","type":"json","z":"8f07cb.68578838","name":"","property":"payload","action":"","pretty":false,"x":530,"y":400,"wires":[["aa938e97.3aa35"]]},{"id":"14eb2c85.916673","type":"webhookrelay","z":"8f07cb.68578838","buckets":"node-red","x":140,"y":400,"wires":[["87796be3.b9aaf8"]]},{"id":"a0717691.c2ae28","type":"trigger","z":"8f07cb.68578838","op1":"ShutterOpen1","op2":"","op1type":"str","op2type":"nul","duration":"12900","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Delay","x":850,"y":360,"wires":[["5b4523eb.ddcd7c"]]},{"id":"7e219595.f90a2c","type":"trigger","z":"8f07cb.68578838","op1":"ShutterClose1","op2":"","op1type":"str","op2type":"nul","duration":"12900","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Delay","x":850,"y":440,"wires":[["5b4523eb.ddcd7c"]]},{"id":"20542941.e35556","type":"bigtimer","z":"8f07cb.68578838","outtopic":"","outpayload1":"Open","outpayload2":"Close","name":"sunrise / sunset","comment":"","lat":"52.2296","lon":"5.1823","starttime":"5004","endtime":"5003","starttime2":"0","endtime2":"0","startoff":"-30","endoff":"0","startoff2":"","endoff2":"","offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":140,"y":120,"wires":[["788956a0.3eae18"],[],[]]},{"id":"32ea4dd9.615cb2","type":"switch","z":"8f07cb.68578838","name":"open/close","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"close","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":100,"wires":[["f6e81ca0.03bed"],["e79bd7eb.d97a28"]]},{"id":"f6e81ca0.03bed","type":"api-current-state","z":"8f07cb.68578838","name":"Abrir estoro enable","server":"7b917f5b.7abab","version":1,"outputs":2,"halt_if":"false","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.abrir_estoro_tempo_bool","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":810,"y":60,"wires":[["69ad4744.6724a8"],[]]},{"id":"e79bd7eb.d97a28","type":"api-current-state","z":"8f07cb.68578838","name":"Fechar estoro enable","server":"7b917f5b.7abab","version":1,"outputs":2,"halt_if":"false","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.fechar_estoro_tempo_bool","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":820,"y":140,"wires":[["2fde9c7e.2ae074"],[]]},{"id":"2fde9c7e.2ae074","type":"trigger","z":"8f07cb.68578838","op1":"ShutterClose1","op2":"","op1type":"str","op2type":"nul","duration":"250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Fechar Estoro","x":1040,"y":140,"wires":[["25c0e0c8.4070d"]]},{"id":"69ad4744.6724a8","type":"trigger","z":"8f07cb.68578838","op1":"ShutterOpen1","op2":"","op1type":"str","op2type":"nul","duration":"250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"Fechar Estoro","x":1040,"y":60,"wires":[["25c0e0c8.4070d"]]},{"id":"25c0e0c8.4070d","type":"link out","z":"8f07cb.68578838","name":"Estoro Quarto","links":["ccdb2d10.0cda7"],"x":1215,"y":80,"wires":[]},{"id":"788956a0.3eae18","type":"api-current-state","z":"8f07cb.68578838","name":"Sol automático state","server":"7b917f5b.7abab","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.automatico_estoro","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":100,"wires":[["32ea4dd9.615cb2"],[]]},{"id":"5b4523eb.ddcd7c","type":"link out","z":"8f07cb.68578838","name":"Estoro Quarto","links":["ccdb2d10.0cda7"],"x":1015,"y":400,"wires":[]},{"id":"967bd4ec.441b58","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"7b917f5b.7abab","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
O que eu gostava agora de fazer é meter o switch de acionada a frente da hora, mas ainda tenho de investigar como se faz xD
Obrigado!!