Hi Everyone,
Here’s my issue. The 1st ‘Get History’ node works correctly but the 2nd and 3rd ‘Get History’ nodes output the same data as the 1st, even though they have a different entity id for each. The reason for the get history nodes is to see if i turned off the lights before i exit the house at night, without checking the history, the lights will turn back on the second i open the door. Any Help is appreciated. Thanks!!!
Heres my Layout:
[
{
"id": "7e17c372.6118dc",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "b515558e.c17298",
"type": "server-state-changed",
"z": "7e17c372.6118dc",
"name": "Front Door Sensor",
"server": "1c6735cc.ed5b5a",
"version": 1,
"entityidfilter": "binary_sensor.wyzesense_77837564",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 1,
"output_only_on_state_change": true,
"x": 170,
"y": 80,
"wires": [
[
"a8cbeb4c.7bed48"
]
]
},
{
"id": "a8cbeb4c.7bed48",
"type": "api-current-state",
"z": "7e17c372.6118dc",
"name": "is it Dusk?",
"server": "1c6735cc.ed5b5a",
"version": 1,
"outputs": 2,
"halt_if": "above_horizon",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sun.sun",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 390,
"y": 80,
"wires": [
[
"aa80c1ca.59ab1"
],
[]
]
},
{
"id": "1037e1ce.b363be",
"type": "api-current-state",
"z": "7e17c372.6118dc",
"name": "Kitchen Light on?",
"server": "1c6735cc.ed5b5a",
"version": 1,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "light.kitchen_lights_13",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 170,
"y": 160,
"wires": [
[
"f9091040.35dbe"
],
[]
]
},
{
"id": "71dad0e2.f3fe5",
"type": "api-current-state",
"z": "7e17c372.6118dc",
"name": "Livingroom Light on?",
"server": "1c6735cc.ed5b5a",
"version": 1,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "light.living_room_lights_14",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 180,
"y": 240,
"wires": [
[
"b249314d.1a25d"
],
[]
]
},
{
"id": "aa80c1ca.59ab1",
"type": "api-current-state",
"z": "7e17c372.6118dc",
"name": "Input Boolean. Do i run?",
"server": "1c6735cc.ed5b5a",
"version": 1,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "input_boolean.auto_home_turn_on_light",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 630,
"y": 80,
"wires": [
[
"1037e1ce.b363be"
],
[]
]
},
{
"id": "a3247207.48caf",
"type": "api-call-service",
"z": "7e17c372.6118dc",
"name": "Turn Living Room Lights On",
"server": "1c6735cc.ed5b5a",
"version": 1,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.living_room_lights_14",
"data": "{\"brightness_pct\":\"100\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 900,
"y": 400,
"wires": [
[]
]
},
{
"id": "cced23b0.435f8",
"type": "api-call-service",
"z": "7e17c372.6118dc",
"name": "Turn Kitchen Lights On",
"server": "1c6735cc.ed5b5a",
"version": 1,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.kitchen_lights_13",
"data": "{\"brightness_pct\":\"100\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 880,
"y": 460,
"wires": [
[]
]
},
{
"id": "ab4e9ea2.fd14c",
"type": "api-current-state",
"z": "7e17c372.6118dc",
"name": "Hallway Lights on?",
"server": "1c6735cc.ed5b5a",
"version": 1,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "switch.hallway_light_6",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 170,
"y": 320,
"wires": [
[
"ecacc74f.ecdac8"
],
[]
]
},
{
"id": "f9091040.35dbe",
"type": "api-get-history",
"z": "7e17c372.6118dc",
"name": "Retrieve History",
"server": "1c6735cc.ed5b5a",
"startdate": "",
"enddate": "",
"entityid": "light.kitchen_lights_13",
"entityidtype": "is",
"useRelativeTime": true,
"relativeTime": "2 mins",
"flatten": false,
"output_type": "array",
"output_location_type": "msg",
"output_location": "payload",
"x": 400,
"y": 160,
"wires": [
[
"618de5d1.00f92c"
]
]
},
{
"id": "b249314d.1a25d",
"type": "api-get-history",
"z": "7e17c372.6118dc",
"name": "Retrieve History",
"server": "1c6735cc.ed5b5a",
"startdate": "",
"enddate": "",
"entityid": "light.living_room_lights_14",
"entityidtype": "is",
"useRelativeTime": true,
"relativeTime": "2 mins",
"flatten": true,
"output_type": "array",
"output_location_type": "msg",
"output_location": "payload",
"x": 400,
"y": 240,
"wires": [
[
"32b855c5.49d4aa"
]
]
},
{
"id": "ecacc74f.ecdac8",
"type": "api-get-history",
"z": "7e17c372.6118dc",
"name": "Retrieve History",
"server": "1c6735cc.ed5b5a",
"startdate": "",
"enddate": "",
"entityid": "switch.hallway_light_6",
"entityidtype": "is",
"useRelativeTime": true,
"relativeTime": "2 mins",
"flatten": true,
"output_type": "array",
"output_location_type": "msg",
"output_location": "payload",
"x": 400,
"y": 320,
"wires": [
[
"6849722.b40df8c"
]
]
},
{
"id": "618de5d1.00f92c",
"type": "switch",
"z": "7e17c372.6118dc",
"name": "Check History",
"property": "payload[0][1]",
"propertyType": "msg",
"rules": [
{
"t": "null"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 600,
"y": 160,
"wires": [
[
"56629908.7b0bb8"
]
]
},
{
"id": "32b855c5.49d4aa",
"type": "switch",
"z": "7e17c372.6118dc",
"name": "Check History",
"property": "payload[0][1]",
"propertyType": "msg",
"rules": [
{
"t": "null"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 600,
"y": 240,
"wires": [
[
"3cdd214a.abf48e"
]
]
},
{
"id": "6849722.b40df8c",
"type": "switch",
"z": "7e17c372.6118dc",
"name": "Check History",
"property": "payload[0][1]",
"propertyType": "msg",
"rules": [
{
"t": "null"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 600,
"y": 320,
"wires": [
[
"1f0fca7f.bf1e76"
]
]
},
{
"id": "56629908.7b0bb8",
"type": "change",
"z": "7e17c372.6118dc",
"name": "Kitchen Clear",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Kitchen Clear",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 160,
"wires": [
[
"71dad0e2.f3fe5"
]
]
},
{
"id": "3cdd214a.abf48e",
"type": "change",
"z": "7e17c372.6118dc",
"name": "Living Room Clear",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Livingroom Clear",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 240,
"wires": [
[
"ab4e9ea2.fd14c"
]
]
},
{
"id": "1f0fca7f.bf1e76",
"type": "change",
"z": "7e17c372.6118dc",
"name": "Hallway Clear",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Hallway Clear",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 800,
"y": 320,
"wires": [
[
"a3247207.48caf",
"cced23b0.435f8"
]
]
},
{
"id": "1c6735cc.ed5b5a",
"type": "server",
"z": "",
"name": "Home Assistant"
}
]