Skip to content

Instantly share code, notes, and snippets.

@frosenlind
Created November 6, 2020 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frosenlind/97536b33866a13753b9f871af03a49c3 to your computer and use it in GitHub Desktop.
Save frosenlind/97536b33866a13753b9f871af03a49c3 to your computer and use it in GitHub Desktop.
Node-Red Simple Home/Away/Sleep sequence
[
{
"id": "c242b7ad.2bbf08",
"type": "poll-state",
"z": "3b4d5e06.abdd82",
"name": "Are you home?",
"server": "b6162a50.c4af78",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"updateinterval": "10",
"updateIntervalUnits": "seconds",
"outputinitially": false,
"outputonchanged": false,
"entity_id": "person.frosenlind",
"state_type": "str",
"halt_if": "home",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"x": 180,
"y": 2360,
"wires": [
[
"53cbe40f.25e56c"
],
[
"ba1e3f34.ef178"
]
],
"outputLabels": [
"Yes",
"No"
]
},
{
"id": "f2fa1323.916ea",
"type": "api-call-service",
"z": "3b4d5e06.abdd82",
"name": "Set house to Home",
"server": "b6162a50.c4af78",
"version": 1,
"debugenabled": false,
"service_domain": "input_select",
"service": "select_option",
"entityId": "input_select.house_state",
"data": "{\"option\":\"home\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 790,
"y": 2328,
"wires": [
[]
]
},
{
"id": "ba1e3f34.ef178",
"type": "api-call-service",
"z": "3b4d5e06.abdd82",
"name": "Set house to Away",
"server": "b6162a50.c4af78",
"version": 1,
"debugenabled": false,
"service_domain": "input_select",
"service": "select_option",
"entityId": "input_select.house_state",
"data": "{\"option\":\"away\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 790,
"y": 2380,
"wires": [
[]
]
},
{
"id": "53cbe40f.25e56c",
"type": "api-current-state",
"z": "3b4d5e06.abdd82",
"name": "Check if sleep",
"server": "b6162a50.c4af78",
"version": 1,
"outputs": 2,
"halt_if": "sleep",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "input_select.house_state",
"state_type": "str",
"state_location": "",
"override_payload": "none",
"entity_location": "",
"override_data": "none",
"blockInputOverrides": false,
"x": 500,
"y": 2320,
"wires": [
[],
[
"f2fa1323.916ea"
]
]
},
{
"id": "c4552d22.c4c16",
"type": "inject",
"z": "3b4d5e06.abdd82",
"name": "",
"props": [],
"repeat": "",
"crontab": "00 06 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 150,
"y": 2440,
"wires": [
[
"8989eadd.6307a8"
]
]
},
{
"id": "8989eadd.6307a8",
"type": "api-call-service",
"z": "3b4d5e06.abdd82",
"name": "Set house to Home",
"server": "b6162a50.c4af78",
"version": 1,
"debugenabled": false,
"service_domain": "input_select",
"service": "select_option",
"entityId": "input_select.house_state",
"data": "{\"option\":\"home\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 790,
"y": 2440,
"wires": [
[]
]
},
{
"id": "b6162a50.c4af78",
"type": "server",
"name": "Home Assistant - New",
"legacy": false,
"addon": false,
"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