Add history tester

This commit is contained in:
2025-03-23 13:58:52 -04:00
parent d9215e8633
commit 115a9cb7eb

View File

@ -2323,6 +2323,25 @@
"w": 632,
"h": 82
},
{
"id": "8bee7892a01cf63b",
"type": "group",
"z": "d49b385d8b582b20",
"name": "History Tester",
"style": {
"label": true
},
"nodes": [
"d812ee2f617dd583",
"d417bebd83c3e0fe",
"a89d872a45eae06c",
"d8facf95084f1638"
],
"x": 794,
"y": 419,
"w": 792,
"h": 82
},
{
"id": "fba69dfc80829db7",
"type": "junction",
@ -35405,5 +35424,100 @@
"x": 1280,
"y": 360,
"wires": []
},
{
"id": "d812ee2f617dd583",
"type": "api-get-history",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "",
"server": "9e87348d.9c1c48",
"version": 1,
"startDate": "",
"endDate": "",
"entityId": "input_select.basement_studio_scenes",
"entityIdType": "equals",
"useRelativeTime": true,
"relativeTime": "8 hours",
"flatten": true,
"outputType": "array",
"outputLocationType": "msg",
"outputLocation": "payload",
"x": 1060,
"y": 460,
"wires": [
[
"d8facf95084f1638"
]
]
},
{
"id": "d417bebd83c3e0fe",
"type": "inject",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 900,
"y": 460,
"wires": [
[
"d812ee2f617dd583"
]
]
},
{
"id": "a89d872a45eae06c",
"type": "debug",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "Get History Tester Output",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1430,
"y": 460,
"wires": []
},
{
"id": "d8facf95084f1638",
"type": "function",
"z": "d49b385d8b582b20",
"g": "8bee7892a01cf63b",
"name": "Filter",
"func": "let states = msg.payload\n\nlet filteredStates = states.filter(function(item) {\n if (item.state) {\n let itemState = item.state\n return itemState != 'Select'\n }\n})\n\nmsg.filtered = filteredStates\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1210,
"y": 460,
"wires": [
[
"a89d872a45eae06c"
]
]
}
]