Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
Last active May 6, 2021 11:20
Show Gist options
  • Save TheGroundZero/691ff7863325e502c8ce0acf92f715a6 to your computer and use it in GitHub Desktop.
Save TheGroundZero/691ff7863325e502c8ce0acf92f715a6 to your computer and use it in GitHub Desktop.
Node-RED flow controlling lights, triggered by motion sensor and overruled by physical switch
[
{
"id": "459b89f5.f3b8f8",
"type": "server-state-changed",
"z": "7798af19.c13fb",
"name": "Beweging",
"server": "2ce15169.23b9de",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "binary_sensor.lumi_lumi_sensor_motion_aq2_00000000_ias_zone",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "habool",
"haltifstate": "true",
"halt_if_type": "bool",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 80,
"y": 220,
"wires": [
[
"bf5bad68.02c728",
"e8822e95.0f9c88"
],
[
"6ae550e5.a42a8"
]
]
},
{
"id": "e8822e95.0f9c88",
"type": "api-call-service",
"z": "7798af19.c13fb",
"name": "Licht aan",
"server": "2ce15169.23b9de",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.toilet_lamp",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 260,
"y": 200,
"wires": [
[]
]
},
{
"id": "80c618b.42cf668",
"type": "api-call-service",
"z": "7798af19.c13fb",
"name": "Licht uit",
"server": "2ce15169.23b9de",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_off",
"entityId": "light.toilet_lamp",
"data": "",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 580,
"y": 280,
"wires": [
[]
]
},
{
"id": "e7163610.8f7958",
"type": "api-current-state",
"z": "7798af19.c13fb",
"name": "Schakelaar?",
"server": "2ce15169.23b9de",
"version": 1,
"outputs": 2,
"halt_if": "true",
"halt_if_type": "bool",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "binary_sensor.shelly_1l_00000000_input_0",
"state_type": "habool",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 410,
"y": 280,
"wires": [
[],
[
"80c618b.42cf668"
]
]
},
{
"id": "6ae550e5.a42a8",
"type": "delay",
"z": "7798af19.c13fb",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "minutes",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 240,
"y": 280,
"wires": [
[
"e7163610.8f7958"
]
]
},
{
"id": "bf5bad68.02c728",
"type": "change",
"z": "7798af19.c13fb",
"name": "",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 280,
"y": 240,
"wires": [
[
"6ae550e5.a42a8"
]
]
},
{
"id": "2ce15169.23b9de",
"type": "server",
"name": "Home Assistant",
"legacy": false,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment