I have come up with this flow to close the garage cover if it has been open for more than 5 or more minutes but it only works when the state changes and not periodically. This means, for example, if the cover is open for 5 minutes or more. I get the iOS alert on my phone, and I press the “Close cover” actionable notification. Still, for some reason, maybe too much light due to the sun messing up with sensors, or something blocking the sensor, or something else, it did not close properly. I won’t know about it because my flow checks only on state change meaning it will trigger only if the cover went from close to open at some point. Can I get some ideas to add a periodic check so I don’t run into issues?
[
{
"id": "e13fb6b3d8f1d842",
"type": "tab",
"label": "GARAGE_DOOR_ALERT",
"disabled": false,
"info": "",
"env": []
},
{
"id": "e76072dc.71e4f",
"type": "server-state-changed",
"z": "e13fb6b3d8f1d842",
"name": "Is the garage door open?",
"server": "e593dd3.052432",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "binary_sensor.garage_door_myq_gateway",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "open",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": "5",
"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": 210,
"y": 140,
"wires": [
[
"784a35516b416c37"
],
[]
],
"outputLabels": [
"\"on\"",
""
]
},
{
"id": "d31e3a7251a42067",
"type": "comment",
"z": "e13fb6b3d8f1d842",
"name": "Send a notification if the garage door is open for more than 5 minutes",
"info": "",
"x": 350,
"y": 100,
"wires": []
},
{
"id": "2115fae878e3b2b8",
"type": "link out",
"z": "e13fb6b3d8f1d842",
"name": "",
"mode": "link",
"links": [
"b6171fec.b478f"
],
"x": 655,
"y": 140,
"wires": []
},
{
"id": "784a35516b416c37",
"type": "change",
"z": "e13fb6b3d8f1d842",
"name": "Set notification attributes",
"rules": [
{
"t": "set",
"p": "title",
"pt": "msg",
"to": "Garage Door",
"tot": "str"
},
{
"t": "set",
"p": "message1",
"pt": "msg",
"to": "The garage door has been open for",
"tot": "str"
},
{
"t": "set",
"p": "message2",
"pt": "msg",
"to": "15",
"tot": "str"
},
{
"t": "set",
"p": "message3",
"pt": "msg",
"to": "minutes!",
"tot": "str"
},
{
"t": "set",
"p": "critical",
"pt": "msg",
"to": "0 or 1",
"tot": "str"
},
{
"t": "set",
"p": "sound",
"pt": "msg",
"to": "default",
"tot": "str"
},
{
"t": "set",
"p": "volume",
"pt": "msg",
"to": "1.0",
"tot": "str"
},
{
"t": "set",
"p": "target",
"pt": "msg",
"to": "mobile_app_iphone",
"tot": "str"
},
{
"t": "set",
"p": "entity_id",
"pt": "msg",
"to": "cover.garage_door",
"tot": "str"
},
{
"t": "set",
"p": "friendly_name",
"pt": "msg",
"to": "Garage Door",
"tot": "str"
},
{
"t": "set",
"p": "event_action",
"pt": "msg",
"to": "CLOSE_GARAGE_DOOR",
"tot": "str"
},
{
"t": "set",
"p": "event_action_title",
"pt": "msg",
"to": "Close Garage Door",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 470,
"y": 140,
"wires": [
[
"2115fae878e3b2b8"
]
]
},
{
"id": "7e7c1b4ffd992a68",
"type": "server-events",
"z": "e13fb6b3d8f1d842",
"name": "",
"server": "e593dd3.052432",
"version": 2,
"eventType": "mobile_app_notification_action",
"exposeToHomeAssistant": false,
"eventData": "",
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "event_type",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "str"
}
],
"event_type": "",
"x": 250,
"y": 280,
"wires": [
[
"89444b2b7c65b773"
]
]
},
{
"id": "61f18ed657b4d247",
"type": "comment",
"z": "e13fb6b3d8f1d842",
"name": "Allow to close the door by pressing on the actionable iOS notification",
"info": "",
"x": 350,
"y": 240,
"wires": []
},
{
"id": "89444b2b7c65b773",
"type": "switch",
"z": "e13fb6b3d8f1d842",
"name": "",
"property": "payload.event.action",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "CLOSE_GARAGE_DOOR",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 510,
"y": 280,
"wires": [
[
"789e8f8a7eb04b52"
]
]
},
{
"id": "789e8f8a7eb04b52",
"type": "api-call-service",
"z": "e13fb6b3d8f1d842",
"name": "",
"server": "e593dd3.052432",
"version": 5,
"debugenabled": false,
"domain": "cover",
"service": "close_cover",
"areaId": [],
"deviceId": [],
"entityId": [
"cover.garage_door"
],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 710,
"y": 280,
"wires": [
[]
]
},
{
"id": "e593dd3.052432",
"type": "server",
"name": "Home Assistant",
"addon": true
}
]
For the notifications I am using this awesome work from some community members: Sharing IOS Notification Template with Example ** Improved **