Garadget, MQTT, Node-RED, Home Assistant, Homekit (or any other voice assistant with HA)

As requested, here a quick guide on integrated Garadget with MQTT, Node-RED, Home Assistant.

You will need to install the custom component in HA for Node-RED. I installed this via HACS.

This allows Node-RED to create entities into HA. e.g. a Sensor.

Some of my Node-RED flow may be over the top, however I have cleaned up some of the formatting so it presents nicely into HA. It also includes the icons and unit of measure.

There is also a rolling 1min poll of the status to update the sensors, the RDE node make it that only changes are reported to the HA sensors. The status update is also triggered when the door is “open” or “closed”.

The reason for the open or closed sensor separately is to remove any issues around the status being unknown and it seems that Homekit only likes it “open” or “closed”

Here is the code for Node-RED, you can update the topic and MQTT server info.

Node-RED.txt (11.5 KB)

Here is my configuration.yaml

cover:
  - platform: mqtt
    name: "Garage Door MQTT"
    device_class: 'garage'
    command_topic: "garadget/Garage/command"
    state_topic: "garadget/Garage/status"
    value_template: "{{ states('sensor.node_red_garage_door_open_or_closed') }}"
    payload_open: "open"
    payload_close: "close"
    payload_stop:

I have the payload for “stop” removed, leaving it blank removes the option to stop the door. I had issues with the stop command simply making my door go back down. It was simple to just remove it and let it go completely up or down.

image

Lovelace Card config:

type: entities
entities:
  - entity: cover.garage_door_mqtt
    name: Garage Door
  - entity: sensor.node_red_garage_door_state
    name: State
  - entity: sensor.node_red_garage_door_time_in_state
    name: Time in State
  - entity: sensor.node_red_garage_door_sensor_reflection_rate
    name: Sensor Reflection Rate
  - entity: sensor.node_red_garage_ambient_light_brightness
    name: Ambient Light Brightness
  - entity: sensor.node_red_garage_door_wifi_signal
    name: Wifi Signal
title: Garage Door

I have Homekit integrated with HA and the door works perfectly.

1 Like

slight update:

With the above configuration, I had that Home Assistant could only operate up or down. No stop commands.

However if the button is pressed in Homekit multiple times it can cause issues. I now have a check on the command so it can only go up or down via checking the state first.

HA sends MQTT commands to NodeRED, NodeRED updates HA on the state of the Garage.

NodeRED talks to Garadge via MQTT

It is also a little more simple than above, with the opening closing status also correctly tracked via HA as I can filter that information via NodeRED.

Home Assistant now shows the icon changes when opening / closing.

You can simply copy what I have, just make sure your topics are updated and server info.

[{"id":"103cc67.8a2a33a","type":"mqtt in","z":"53aabe5c.55603","name":"","topic":"garadget/Garage/status","qos":"2","datatype":"utf8","broker":"4d42f578.4cd4ac","x":180,"y":480,"wires":[["9a03810b.daabf"]]},{"id":"d9c45e63.3f094","type":"mqtt out","z":"53aabe5c.55603","name":"","topic":"garadget/Garage/command","qos":"2","retain":"","broker":"4d42f578.4cd4ac","x":1660,"y":840,"wires":[]},{"id":"8a1f7e79.9715a","type":"inject","z":"53aabe5c.55603","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"get-status","payloadType":"str","x":1370,"y":760,"wires":[["d9c45e63.3f094"]]},{"id":"9a03810b.daabf","type":"json","z":"53aabe5c.55603","name":"","property":"payload","action":"","pretty":false,"x":370,"y":480,"wires":[["452f6560.cc4e7c","ec717606.a82b18","df68cd3a.5620b","fbbcffad.76bf5","f3a60b8c.d33228"]]},{"id":"fbbcffad.76bf5","type":"change","z":"53aabe5c.55603","name":"Garage Ambient Light Brightness","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.bright","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":480,"wires":[["ae035efe.81b26"]]},{"id":"f3a60b8c.d33228","type":"change","z":"53aabe5c.55603","name":"Wifi Signal","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.signal","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":560,"wires":[["41381105.63a09"]]},{"id":"41381105.63a09","type":"rbe","z":"53aabe5c.55603","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":560,"wires":[["1c3fea87.71a365"]]},{"id":"ae035efe.81b26","type":"rbe","z":"53aabe5c.55603","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":480,"wires":[["1ad94266.96dfbe"]]},{"id":"ec717606.a82b18","type":"change","z":"53aabe5c.55603","name":"Time in State","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":320,"wires":[["a2eca8de.38ba98"]]},{"id":"df68cd3a.5620b","type":"change","z":"53aabe5c.55603","name":"Garage Sensor","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.sensor","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":400,"wires":[["1369d041.cd7bb"]]},{"id":"1369d041.cd7bb","type":"rbe","z":"53aabe5c.55603","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":400,"wires":[["45a076f4.547c48"]]},{"id":"a2eca8de.38ba98","type":"rbe","z":"53aabe5c.55603","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":320,"wires":[["930d9ec2.0a584"]]},{"id":"452f6560.cc4e7c","type":"change","z":"53aabe5c.55603","name":"Garage State","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.status","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":640,"wires":[["fbffadd2.3b908","bbf82f95.bea51"]]},{"id":"7ae47241.c6ad7c","type":"mqtt in","z":"53aabe5c.55603","name":"","topic":"garadget/Garage/command","qos":"2","datatype":"utf8","broker":"4d42f578.4cd4ac","x":200,"y":140,"wires":[["628ec43e.083e6c"]]},{"id":"628ec43e.083e6c","type":"debug","z":"53aabe5c.55603","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":430,"y":140,"wires":[]},{"id":"a6c5f13.44eea1","type":"ha-entity","z":"53aabe5c.55603","name":"Garage Door State","server":"613f67e5.e69a28","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door State"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:garage-alert"},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1530,"y":640,"wires":[[]]},{"id":"6da1fc03.c126f4","type":"ha-entity","z":"53aabe5c.55603","name":"Garage Door Time in State","server":"613f67e5.e69a28","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Time in State"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:timer"},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1560,"y":320,"wires":[[]]},{"id":"45a076f4.547c48","type":"ha-entity","z":"53aabe5c.55603","name":"Garage Door Sensor Reflection Rate","server":"613f67e5.e69a28","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Sensor Reflection Rate"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:laser-pointer"},{"property":"unit_of_measurement","value":"%"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1590,"y":400,"wires":[[]]},{"id":"1ad94266.96dfbe","type":"ha-entity","z":"53aabe5c.55603","name":"Garage Ambient Light Brightness","server":"613f67e5.e69a28","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Ambient Light Brightness"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:brightness-percent"},{"property":"unit_of_measurement","value":"%"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1580,"y":480,"wires":[[]]},{"id":"1c3fea87.71a365","type":"ha-entity","z":"53aabe5c.55603","name":"Garage Door Wifi Signal","server":"613f67e5.e69a28","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Garage Door Wifi Signal"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:wifi"},{"property":"unit_of_measurement","value":"dB"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1550,"y":560,"wires":[[]]},{"id":"23e8e7f3.39a128","type":"change","z":"53aabe5c.55603","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"open","fromt":"str","to":"Open","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"closed","fromt":"str","to":"Closed","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"opening","fromt":"str","to":"Opening","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"closing","fromt":"str","to":"Closing","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"stopped","fromt":"str","to":"Stopped","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":640,"wires":[["a6c5f13.44eea1"]]},{"id":"930d9ec2.0a584","type":"switch","z":"53aabe5c.55603","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"s","vt":"str","case":false},{"t":"regex","v":"m","vt":"str","case":false},{"t":"regex","v":"h","vt":"str","case":false},{"t":"regex","v":"d","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":300,"wires":[["c58dacd2.f6979"],["ffbeeacc.149518"],["301b6844.340c18"],["f1c84bf2.727868"]]},{"id":"ffbeeacc.149518","type":"change","z":"53aabe5c.55603","name":"Minutes","rules":[{"t":"change","p":"payload","pt":"msg","from":"m","fromt":"str","to":" Minutes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":240,"wires":[["6da1fc03.c126f4"]]},{"id":"c58dacd2.f6979","type":"change","z":"53aabe5c.55603","name":"Seconds","rules":[{"t":"change","p":"payload","pt":"msg","from":"s","fromt":"str","to":" Seconds","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":200,"wires":[["6da1fc03.c126f4"]]},{"id":"301b6844.340c18","type":"change","z":"53aabe5c.55603","name":"Hours","rules":[{"t":"change","p":"payload","pt":"msg","from":"h","fromt":"str","to":" Hours","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":280,"wires":[["6da1fc03.c126f4"]]},{"id":"f1c84bf2.727868","type":"change","z":"53aabe5c.55603","name":"Days","rules":[{"t":"change","p":"payload","pt":"msg","from":"d","fromt":"str","to":" Days","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":320,"wires":[["6da1fc03.c126f4"]]},{"id":"fbffadd2.3b908","type":"rbe","z":"53aabe5c.55603","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":640,"wires":[["23e8e7f3.39a128"]]},{"id":"dbc0234.12513e","type":"comment","z":"53aabe5c.55603","name":"Poll Status Every 60 Secs","info":"","x":1330,"y":720,"wires":[]},{"id":"bf3b359d.1a1e88","type":"api-current-state","z":"53aabe5c.55603","name":"Garage Door Closed?","server":"613f67e5.e69a28","version":1,"outputs":2,"halt_if":"closed","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"cover.garage_door_mqtt","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1140,"y":800,"wires":[["87ecae59.f487a"],[]]},{"id":"8c0ed406.476668","type":"api-current-state","z":"53aabe5c.55603","name":"Garage Door Open?","server":"613f67e5.e69a28","version":1,"outputs":2,"halt_if":"open","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"cover.garage_door_mqtt","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1140,"y":880,"wires":[["e00344ed.566978"],[]]},{"id":"87ecae59.f487a","type":"change","z":"53aabe5c.55603","name":"Open Garage","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":800,"wires":[["d9c45e63.3f094"]]},{"id":"e00344ed.566978","type":"change","z":"53aabe5c.55603","name":"Close Garage","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":880,"wires":[["d9c45e63.3f094"]]},{"id":"b9e57d24.80b1c","type":"mqtt in","z":"53aabe5c.55603","name":"","topic":"nodered/Garage/command","qos":"2","datatype":"utf8","broker":"4d42f578.4cd4ac","x":610,"y":840,"wires":[["4fdc9198.65939"]]},{"id":"4fdc9198.65939","type":"switch","z":"53aabe5c.55603","name":"Open or 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":880,"y":840,"wires":[["bf3b359d.1a1e88"],["8c0ed406.476668"]]},{"id":"9df3db3c.d07ee8","type":"inject","z":"53aabe5c.55603","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"open","payloadType":"str","x":670,"y":880,"wires":[["4fdc9198.65939"]]},{"id":"f6e4e3a1.e133e","type":"inject","z":"53aabe5c.55603","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"close","payloadType":"str","x":670,"y":920,"wires":[["4fdc9198.65939"]]},{"id":"bbf82f95.bea51","type":"switch","z":"53aabe5c.55603","name":"Open, Closed, Opening & Closing","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"closed","vt":"str"},{"t":"eq","v":"opening","vt":"str"},{"t":"eq","v":"closing","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":640,"y":740,"wires":[["27d98cc8.1e2f54"],["27d98cc8.1e2f54"],["27d98cc8.1e2f54"],["27d98cc8.1e2f54"]]},{"id":"27d98cc8.1e2f54","type":"mqtt out","z":"53aabe5c.55603","name":"","topic":"nodered/Garage/status","qos":"2","retain":"","broker":"4d42f578.4cd4ac","x":1080,"y":740,"wires":[]},{"id":"4d42f578.4cd4ac","type":"mqtt-broker","name":"","broker":"192.168.0.10","port":"1883","clientid":"Node-RED","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"613f67e5.e69a28","type":"server","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

  - platform: mqtt
    name: "Garage Door MQTT"
    device_class: 'garage'
    command_topic: "nodered/Garage/command"
    state_topic: "nodered/Garage/status"
    payload_open: "open"
    payload_close: "close"
    payload_stop:

The lovelace config is still the save as above.

When doing like mentioned above, I still get following: (I am able to see all the status updates, and rest of the information, but no controls to control the gate itself.
Lovelace:

Configuration yaml:

Probably on the way my configuration.yaml is configured.
Can someone point me in the right direction to get this working?

Thanks,

On your configuration.yaml for the MQTT topic you are trying to talk to Garadget directly if see my example I have home assistant talking to node-red first via MQTT then pass via the logic. So just need to update that config, change Garadget to the Node-Red topic.

@Linxory

image

Hi,

So as you mentioned, changed this to nodered, all works fine, except the controls for the door not showing up. Still giving me in the lovelace card:
image

image

Wondering what this might be.

The entity cover.xxx is not showing up in my current entity list. Thus unable to control the door from HA.

@Lebowski9000 Do you see something in my config as linked above that could cause this?

Thanks,

Regards,

@Linxory can you control the garage from Node-RED? using the open and close inputs?

From your config, you should have “cover.garagedoor” as an entity to control.

This is mine, yours will be slightly different.

Ok, just tried it indeed in Node-red itself, no results.

Was checking with MQTT explorer to see if I received anything in my broker.

I see no payload commands:

image

So might think it has to do with the link between Garadget and my (local) MQTT broker.

Do you see the payloads that you are sending? Would assume that these are visible as well.
Thanks,

Regards,

I do see commands:

image

@Lebowski9000 I’m using your node red flow (it’s amazing, thank you!) but I’m seeing constant errors in my debug log in node red from the JSON input. Are you seeing the same thing?

The error is Unexpected token c in JSON at position 0

So sorry for the late reply, I have not touched it in a very long time, everything has been working well from my end. I have made some updates however. This helped with interrupting the door motion and sensor values.

[{"id":"6bb3f579.c6517c","type":"mqtt in","z":"47ce9897.cb9ce8","name":"","topic":"garadget/Garage/status","qos":"2","datatype":"utf8","broker":"ea8c8ded.029d7","inputs":0,"x":140,"y":220,"wires":[["20031f46.ca772"]]},{"id":"f93d97d3.2fa038","type":"inject","z":"47ce9897.cb9ce8","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"get-status","payloadType":"str","x":1510,"y":840,"wires":[["7267cea8.4d77f"]]},{"id":"20031f46.ca772","type":"json","z":"47ce9897.cb9ce8","name":"","property":"payload","action":"","pretty":false,"x":330,"y":220,"wires":[["5ad15eb.dd143a","6118d093.b265c","366cd6ce.34645a","fd0e9448.63d1f8","7115d758.bf4ff8"]]},{"id":"fd0e9448.63d1f8","type":"change","z":"47ce9897.cb9ce8","name":"Garage Ambient Light Brightness","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.bright","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":340,"wires":[["31c146b3.d7707a"]]},{"id":"7115d758.bf4ff8","type":"change","z":"47ce9897.cb9ce8","name":"Wifi Signal","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.signal","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":400,"wires":[["19503d2b.7d2013"]]},{"id":"19503d2b.7d2013","type":"rbe","z":"47ce9897.cb9ce8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":400,"wires":[["c1977671.8141c8"]]},{"id":"31c146b3.d7707a","type":"rbe","z":"47ce9897.cb9ce8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":340,"wires":[["5cf6e25a.f21ccc"]]},{"id":"6118d093.b265c","type":"change","z":"47ce9897.cb9ce8","name":"Time in State","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":220,"wires":[["ead8578d.76c378"]]},{"id":"366cd6ce.34645a","type":"change","z":"47ce9897.cb9ce8","name":"Garage Sensor","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.sensor","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":280,"wires":[["1a045a9b.c6ea85"]]},{"id":"1a045a9b.c6ea85","type":"rbe","z":"47ce9897.cb9ce8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":280,"wires":[["a5c08401.6c5948"]]},{"id":"ead8578d.76c378","type":"rbe","z":"47ce9897.cb9ce8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":220,"wires":[["364a186a.6deb28"]]},{"id":"5ad15eb.dd143a","type":"change","z":"47ce9897.cb9ce8","name":"Garage State","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.status","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":520,"wires":[["8ce580e9.cee32"]]},{"id":"71580d3c.e919b4","type":"mqtt in","z":"47ce9897.cb9ce8","name":"","topic":"garadget/Garage/command","qos":"2","datatype":"utf8","broker":"ea8c8ded.029d7","inputs":0,"x":160,"y":140,"wires":[["ba7853ac.296eb"]]},{"id":"d411d741.f5da08","type":"ha-entity","z":"47ce9897.cb9ce8","name":"Garage Door Time in State","server":"3b58205e.529ca","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Time in State"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:timer"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1540,"y":220,"wires":[[]]},{"id":"a5c08401.6c5948","type":"ha-entity","z":"47ce9897.cb9ce8","name":"Garage Door Sensor Reflection Rate","server":"3b58205e.529ca","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Sensor Reflection Rate"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:laser-pointer"},{"property":"unit_of_measurement","value":"%"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":1570,"y":280,"wires":[[]]},{"id":"5cf6e25a.f21ccc","type":"ha-entity","z":"47ce9897.cb9ce8","name":"Garage Ambient Light Brightness","server":"3b58205e.529ca","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Ambient Light Brightness"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:brightness-percent"},{"property":"unit_of_measurement","value":"%"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":1560,"y":340,"wires":[[]]},{"id":"c1977671.8141c8","type":"ha-entity","z":"47ce9897.cb9ce8","name":"Garage Door Wifi Signal","server":"3b58205e.529ca","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Wifi Signal"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:wifi"},{"property":"unit_of_measurement","value":"dB"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":1530,"y":400,"wires":[[]]},{"id":"364a186a.6deb28","type":"switch","z":"47ce9897.cb9ce8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"s","vt":"str","case":false},{"t":"regex","v":"m","vt":"str","case":false},{"t":"regex","v":"h","vt":"str","case":false},{"t":"regex","v":"d","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":200,"wires":[["afd71e9f.8c82c"],["d6035a18.268a28"],["8c5523eb.76622"],["38aa1a37.17c326"]]},{"id":"d6035a18.268a28","type":"change","z":"47ce9897.cb9ce8","name":"Minutes","rules":[{"t":"change","p":"payload","pt":"msg","from":"m","fromt":"str","to":" Minutes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1260,"y":140,"wires":[["d411d741.f5da08"]]},{"id":"afd71e9f.8c82c","type":"change","z":"47ce9897.cb9ce8","name":"Seconds","rules":[{"t":"change","p":"payload","pt":"msg","from":"s","fromt":"str","to":" Seconds","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1260,"y":100,"wires":[["d411d741.f5da08"]]},{"id":"8c5523eb.76622","type":"change","z":"47ce9897.cb9ce8","name":"Hours","rules":[{"t":"change","p":"payload","pt":"msg","from":"h","fromt":"str","to":" Hours","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":180,"wires":[["d411d741.f5da08"]]},{"id":"38aa1a37.17c326","type":"change","z":"47ce9897.cb9ce8","name":"Days","rules":[{"t":"change","p":"payload","pt":"msg","from":"d","fromt":"str","to":" Days","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":220,"wires":[["d411d741.f5da08"]]},{"id":"73b7645b.74ebcc","type":"comment","z":"47ce9897.cb9ce8","name":"Poll Status Every 60 Secs","info":"","x":1530,"y":800,"wires":[]},{"id":"8ce580e9.cee32","type":"switch","z":"47ce9897.cb9ce8","name":"Open, Closed, Opening, Closing & Stopped","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"closed","vt":"str"},{"t":"eq","v":"opening","vt":"str"},{"t":"eq","v":"closing","vt":"str"},{"t":"eq","v":"stopped","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":990,"y":520,"wires":[["11b11787.b931d8","ccf36ea8.d79c5","1e276109.daa2cf"],["11b11787.b931d8","ccf36ea8.d79c5","1e276109.daa2cf"],["11b11787.b931d8","ccf36ea8.d79c5","1e276109.daa2cf"],["11b11787.b931d8","ccf36ea8.d79c5","1e276109.daa2cf"],["11b11787.b931d8"]]},{"id":"9ad96a87.0d4e88","type":"mqtt in","z":"47ce9897.cb9ce8","name":"","topic":"nodered/Garage/command","qos":"2","datatype":"utf8","broker":"ea8c8ded.029d7","inputs":0,"x":150,"y":720,"wires":[["d4c1a09d.ae939"]]},{"id":"d4c1a09d.ae939","type":"switch","z":"47ce9897.cb9ce8","name":"Stop, Open or Close","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"stop","vt":"str"},{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"close","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":280,"y":920,"wires":[["eab2c216.14d55","f338354e.83ac88"],["ec6463eb.f0cc3","6c07317.347c9d","b52c3bab.f66dc8"],["7c022aba.845be4","7af82800.f9a168","11fed15d.e05dff"]]},{"id":"29d8a8d0.56b328","type":"inject","z":"47ce9897.cb9ce8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"open","payloadType":"str","x":210,"y":800,"wires":[["d4c1a09d.ae939"]]},{"id":"3aaf3990.31ef76","type":"inject","z":"47ce9897.cb9ce8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"close","payloadType":"str","x":210,"y":840,"wires":[["d4c1a09d.ae939"]]},{"id":"1b170811.a60ab8","type":"inject","z":"47ce9897.cb9ce8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"stop","payloadType":"str","x":210,"y":760,"wires":[["d4c1a09d.ae939"]]},{"id":"7267cea8.4d77f","type":"mqtt out","z":"47ce9897.cb9ce8","name":"","topic":"garadget/Garage/command","qos":"2","retain":"","broker":"ea8c8ded.029d7","x":1540,"y":880,"wires":[]},{"id":"7ac27027.ea41f","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Closed?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"closed","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":860,"y":800,"wires":[["905ed37c.45ac1"],[]]},{"id":"11726a34.9e2f86","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Open?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"open","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":860,"y":1040,"wires":[["1cdd4d0e.d29c43"],[]]},{"id":"59008266.085acc","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Opening?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"opening","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":850,"y":640,"wires":[["eb5c749b.e461f8","86860414.853238"],[]]},{"id":"c6b07f1d.beb64","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Closing?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"closing","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":860,"y":720,"wires":[["27c1af5a.0471a","86860414.853238"],[]]},{"id":"600b8800.165f48","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Opening_Stopped?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"opening_stopped","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":820,"y":1120,"wires":[["1cdd4d0e.d29c43"],[]]},{"id":"eb5c749b.e461f8","type":"change","z":"47ce9897.cb9ce8","name":"Opening_Stopped","rules":[{"t":"set","p":"payload","pt":"msg","to":"opening_stopped","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1510,"y":720,"wires":[["ccf36ea8.d79c5","9735bf93.5e164"]]},{"id":"27c1af5a.0471a","type":"change","z":"47ce9897.cb9ce8","name":"Closing_Stopped","rules":[{"t":"set","p":"payload","pt":"msg","to":"closing_stopped","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1510,"y":760,"wires":[["ccf36ea8.d79c5","f8bc2840.f6f938"]]},{"id":"a746f8e.c92fa08","type":"ha-entity","z":"47ce9897.cb9ce8","name":"Garage Door State","server":"3b58205e.529ca","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door State"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:garage-alert"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":1790,"y":460,"wires":[[]]},{"id":"905ed37c.45ac1","type":"change","z":"47ce9897.cb9ce8","name":"Open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":980,"wires":[["7267cea8.4d77f"]]},{"id":"1cdd4d0e.d29c43","type":"change","z":"47ce9897.cb9ce8","name":"Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":1020,"wires":[["7267cea8.4d77f"]]},{"id":"86860414.853238","type":"change","z":"47ce9897.cb9ce8","name":"Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":1060,"wires":[["7267cea8.4d77f"]]},{"id":"1e276109.daa2cf","type":"change","z":"47ce9897.cb9ce8","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"open","fromt":"str","to":"Open","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"closed","fromt":"str","to":"Closed","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"opening","fromt":"str","to":"Opening","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"closing","fromt":"str","to":"Closing","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1500,"y":460,"wires":[["a746f8e.c92fa08"]]},{"id":"ccf36ea8.d79c5","type":"ha-entity","z":"47ce9897.cb9ce8","name":"Garage Door Logic","server":"3b58205e.529ca","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Node-RED Garage Door Logic"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:garage-alert"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1510,"y":580,"wires":[[]]},{"id":"11b11787.b931d8","type":"mqtt out","z":"47ce9897.cb9ce8","name":"","topic":"nodered/Garage/status","qos":"2","retain":"","broker":"ea8c8ded.029d7","x":1520,"y":520,"wires":[]},{"id":"4ffe2126.286f3","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Closing_Stopped?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"closing_stopped","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":830,"y":880,"wires":[["905ed37c.45ac1"],[]]},{"id":"9735bf93.5e164","type":"change","z":"47ce9897.cb9ce8","name":"Opening Stopped","rules":[{"t":"set","p":"payload","pt":"msg","to":"Opening Stopped","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1510,"y":640,"wires":[["a746f8e.c92fa08"]]},{"id":"f8bc2840.f6f938","type":"change","z":"47ce9897.cb9ce8","name":"Closing Stopped","rules":[{"t":"set","p":"payload","pt":"msg","to":"Closing Stopped","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1500,"y":680,"wires":[["a746f8e.c92fa08"]]},{"id":"ba7853ac.296eb","type":"debug","z":"47ce9897.cb9ce8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":390,"y":140,"wires":[]},{"id":"eab2c216.14d55","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":640,"wires":[["59008266.085acc"]]},{"id":"f338354e.83ac88","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":720,"wires":[["c6b07f1d.beb64"]]},{"id":"ec6463eb.f0cc3","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":880,"wires":[["4ffe2126.286f3"]]},{"id":"7c022aba.845be4","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":1120,"wires":[["600b8800.165f48"]]},{"id":"6c07317.347c9d","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":800,"wires":[["7ac27027.ea41f"]]},{"id":"7af82800.f9a168","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":1040,"wires":[["11726a34.9e2f86"]]},{"id":"ce80b765.a32428","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Opening?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"opening","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":850,"y":1200,"wires":[["eb5c749b.e461f8","f9c67bac.1508f8","86860414.853238"],[]]},{"id":"7107178b.8e9ea8","type":"api-current-state","z":"47ce9897.cb9ce8","name":"Garage Door Closing?","server":"3b58205e.529ca","version":3,"outputs":2,"halt_if":"closing","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.node_red_garage_door_logic","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":860,"y":960,"wires":[["fa3fdc52.1dd61","27c1af5a.0471a","86860414.853238"],[]]},{"id":"11fed15d.e05dff","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":1200,"wires":[["ce80b765.a32428"]]},{"id":"b52c3bab.f66dc8","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":530,"y":960,"wires":[["7107178b.8e9ea8"]]},{"id":"f9c67bac.1508f8","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1480,"y":1140,"wires":[["1cdd4d0e.d29c43"]]},{"id":"fa3fdc52.1dd61","type":"delay","z":"47ce9897.cb9ce8","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1480,"y":1100,"wires":[["905ed37c.45ac1"]]},{"id":"e822d3e.24ca53","type":"mqtt in","z":"47ce9897.cb9ce8","name":"","topic":"#","qos":"2","datatype":"auto","broker":"ea8c8ded.029d7","inputs":0,"x":90,"y":80,"wires":[["83732818.d5bd88"]]},{"id":"83732818.d5bd88","type":"debug","z":"47ce9897.cb9ce8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":250,"y":80,"wires":[]},{"id":"ea8c8ded.029d7","type":"mqtt-broker","name":"","broker":"192.168.0.4","port":"1883","clientid":"Node-RED","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"3b58205e.529ca","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Thanks for that! I haven’t seen that error in a while now so it seems to be working.

My new issue is that sometimes MQTT goes nuts and rapidly updates the status from open to closed (dozens of times) while the garage is sitting open. This appears as a notification in Homekit updating the status each time. Below is my config for the cover. Should I be using the value template pointing at the node red state sensor instead?

cover:
  - platform: mqtt
    name: "Chamber of Secrets"
    device_class: "garage"
    command_topic: "nodered/Garage/command"
    state_topic: "nodered/Garage/status"
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    unique_id: cover.ChamberofSecrets

I do see that also but I have not changed the sensitivity of the sensor, I think its related to that as when my door open the reflection point is closer. I need to play around with that setting in the unit itself.