Hi!
Hmm. When looking at the flow again today it seems to work I will validate a bit more…
Here is the code by the way:
[
{
"id": "577952c40573e083",
"type": "server-state-changed",
"z": "a8def6d13f69b9b1",
"name": "No motion vardagsrum 15 min",
"server": "2545e2ef.9a5a0e",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "binary_sensor.ir_vardagsrum",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "habool",
"haltifstate": "false",
"halt_if_type": "bool",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": false,
"for": "10",
"forType": "num",
"forUnits": "seconds",
"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": 360,
"y": 1640,
"wires": [
[
"14176ba016edc25f"
],
[]
]
},
{
"id": "14176ba016edc25f",
"type": "api-current-state",
"z": "a8def6d13f69b9b1",
"name": "Already On?",
"server": "2545e2ef.9a5a0e",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.vrum_taklampa",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "light_orig_state",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"x": 590,
"y": 1640,
"wires": [
[
"7a95a871fa826a47"
],
[]
]
},
{
"id": "7a95a871fa826a47",
"type": "api-call-service",
"z": "a8def6d13f69b9b1",
"name": "Dim down",
"server": "2545e2ef.9a5a0e",
"version": 5,
"debugenabled": true,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"light.vrum_taklampa"
],
"data": "{ \"brightness\": 10 }",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "true",
"valueType": "bool"
}
],
"queue": "none",
"x": 760,
"y": 1640,
"wires": [
[
"a07dcb79f051981e"
]
]
},
{
"id": "a07dcb79f051981e",
"type": "ha-wait-until",
"z": "a8def6d13f69b9b1",
"name": "pause 1 min",
"server": "2545e2ef.9a5a0e",
"version": 1,
"outputs": 2,
"entityId": "binary_sensor.ir_vardagsrum",
"entityIdFilterType": "exact",
"property": "state",
"comparator": "is",
"value": "on",
"valueType": "str",
"timeout": "10",
"timeoutType": "num",
"timeoutUnits": "seconds",
"entityLocation": "data",
"entityLocationType": "none",
"checkCurrentState": true,
"blockInputOverrides": true,
"x": 950,
"y": 1640,
"wires": [
[
"1e35fb489f889768"
],
[
"6cac6d63981041bc"
]
]
},
{
"id": "b4988af385f071ee",
"type": "api-call-service",
"z": "a8def6d13f69b9b1",
"name": "OFF",
"server": "2545e2ef.9a5a0e",
"version": 5,
"debugenabled": false,
"domain": "light",
"service": "turn_off",
"areaId": [],
"deviceId": [],
"entityId": [
"light.vrum_taklampa"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1390,
"y": 1660,
"wires": [
[]
]
},
{
"id": "6cac6d63981041bc",
"type": "api-call-service",
"z": "a8def6d13f69b9b1",
"name": "Restore brightness",
"server": "2545e2ef.9a5a0e",
"version": 5,
"debugenabled": true,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"light.vrum_taklampa"
],
"data": "{\"brightness\":\"{{light_orig_state.attributes.brightness}}\",\"transition\":1}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1150,
"y": 1680,
"wires": [
[
"b4988af385f071ee"
]
]
},
{
"id": "5d8cca040307fbbb",
"type": "inject",
"z": "a8def6d13f69b9b1",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 400,
"y": 1720,
"wires": [
[
"14176ba016edc25f"
]
]
},
{
"id": "1e35fb489f889768",
"type": "api-call-service",
"z": "a8def6d13f69b9b1",
"name": "Restore brightness",
"server": "2545e2ef.9a5a0e",
"version": 5,
"debugenabled": true,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"light.vrum_taklampa"
],
"data": "{\"brightness\":\"{{light_orig_state.attributes.brightness}}\",\"transition\":1}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1150,
"y": 1620,
"wires": [
[]
]
},
{
"id": "2545e2ef.9a5a0e",
"type": "server",
"name": "Home Assistant",
"version": 4,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30,
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "at: ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m"
}
]