Fix wife's work tomorrow sensor getting stuck on today's workday
This commit is contained in:
194
flows.json
194
flows.json
@ -779,9 +779,7 @@
|
||||
"f1dbb3a206dba921"
|
||||
],
|
||||
"x": 14,
|
||||
"y": 719,
|
||||
"w": 1552,
|
||||
"h": 642
|
||||
"y": 719
|
||||
},
|
||||
{
|
||||
"id": "e065b1ed4938b477",
|
||||
@ -859,9 +857,7 @@
|
||||
"ed625c0b4f7c98ff"
|
||||
],
|
||||
"x": 14,
|
||||
"y": 19,
|
||||
"w": 2252,
|
||||
"h": 682
|
||||
"y": 19
|
||||
},
|
||||
{
|
||||
"id": "5c50443a84910fb7",
|
||||
@ -7328,38 +7324,7 @@
|
||||
"y": 640,
|
||||
"wires": [
|
||||
[
|
||||
"828e99767076eae5"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "828e99767076eae5",
|
||||
"type": "switch",
|
||||
"z": "e44b1e7a8ef7ae1d",
|
||||
"name": "Is Event Tomorrow",
|
||||
"property": "tomorrow",
|
||||
"propertyType": "msg",
|
||||
"rules": [
|
||||
{
|
||||
"t": "gt",
|
||||
"v": "0",
|
||||
"vt": "num"
|
||||
},
|
||||
{
|
||||
"t": "else"
|
||||
}
|
||||
],
|
||||
"checkall": "true",
|
||||
"repair": false,
|
||||
"outputs": 2,
|
||||
"x": 370,
|
||||
"y": 640,
|
||||
"wires": [
|
||||
[
|
||||
"f5eb76f93946aad3"
|
||||
],
|
||||
[
|
||||
"62b61a9d45d27b46"
|
||||
"a605e8b865992be7"
|
||||
]
|
||||
]
|
||||
},
|
||||
@ -7426,64 +7391,10 @@
|
||||
],
|
||||
"inputOverride": "allow",
|
||||
"outputProperties": [],
|
||||
"x": 740,
|
||||
"y": 640,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f5eb76f93946aad3",
|
||||
"type": "change",
|
||||
"z": "e44b1e7a8ef7ae1d",
|
||||
"name": "Set True",
|
||||
"rules": [
|
||||
{
|
||||
"t": "set",
|
||||
"p": "work_tomorrow",
|
||||
"pt": "msg",
|
||||
"to": "true",
|
||||
"tot": "str"
|
||||
}
|
||||
],
|
||||
"action": "",
|
||||
"property": "",
|
||||
"from": "",
|
||||
"to": "",
|
||||
"reg": false,
|
||||
"x": 560,
|
||||
"x": 620,
|
||||
"y": 600,
|
||||
"wires": [
|
||||
[
|
||||
"798ff6ede18394ea"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "62b61a9d45d27b46",
|
||||
"type": "change",
|
||||
"z": "e44b1e7a8ef7ae1d",
|
||||
"name": "Set False",
|
||||
"rules": [
|
||||
{
|
||||
"t": "set",
|
||||
"p": "work_tomorrow",
|
||||
"pt": "msg",
|
||||
"to": "false",
|
||||
"tot": "str"
|
||||
}
|
||||
],
|
||||
"action": "",
|
||||
"property": "",
|
||||
"from": "",
|
||||
"to": "",
|
||||
"reg": false,
|
||||
"x": 560,
|
||||
"y": 680,
|
||||
"wires": [
|
||||
[
|
||||
"798ff6ede18394ea"
|
||||
]
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -8417,6 +8328,101 @@
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "a605e8b865992be7",
|
||||
"type": "function",
|
||||
"z": "e44b1e7a8ef7ae1d",
|
||||
"name": "Processing",
|
||||
"func": "var tomorrow = msg.tomorrow\nvar today = msg.today\nvar number = {}\nvar work_tomorrow = {}\n\nif (tomorrow > 0) {\n work_tomorrow = \"true\"\n if (today == 0) {\n number = 0\n } else {\n number = 1\n }\n} else {\n work_tomorrow = \"false\"\n number = 0\n}\n\nmsg.work_tomorrow = work_tomorrow\n\nif (number == 0) {\n node.status({fill:\"green\",shape:\"dot\",text:\"Number 0\"})\n return[msg,null]\n} else {\n node.status({fill:\"green\",shape:\"dot\",text:\"Number 1\"})\n return[null,msg]\n}",
|
||||
"outputs": 2,
|
||||
"noerr": 0,
|
||||
"initialize": "",
|
||||
"finalize": "",
|
||||
"libs": [],
|
||||
"x": 390,
|
||||
"y": 640,
|
||||
"wires": [
|
||||
[
|
||||
"798ff6ede18394ea"
|
||||
],
|
||||
[
|
||||
"469e44739d85f2c7"
|
||||
]
|
||||
],
|
||||
"outputLabels": [
|
||||
"Number 0",
|
||||
"Number 1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "469e44739d85f2c7",
|
||||
"type": "ha-binary-sensor",
|
||||
"z": "e44b1e7a8ef7ae1d",
|
||||
"name": "Work Tomorrow",
|
||||
"entityConfig": "781adad6153d9661",
|
||||
"version": 0,
|
||||
"state": "work_tomorrow",
|
||||
"stateType": "msg",
|
||||
"attributes": [
|
||||
{
|
||||
"property": "date",
|
||||
"value": "payload.1.date",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "eventStart",
|
||||
"value": "payload.1.eventStart",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "eventEnd",
|
||||
"value": "payload.1.eventEnd",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "summary",
|
||||
"value": "payload.1.summary",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "location",
|
||||
"value": "payload.1.location",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "isRecurring",
|
||||
"value": "payload.1.isRecurring",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "allDay",
|
||||
"value": "payload.1.allDay",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "calendarName",
|
||||
"value": "payload.1.calendarName",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "countdown",
|
||||
"value": "payload.1.countdown",
|
||||
"valueType": "msg"
|
||||
},
|
||||
{
|
||||
"property": "start_timestamp",
|
||||
"value": "payload.1.uid.date",
|
||||
"valueType": "msg"
|
||||
}
|
||||
],
|
||||
"inputOverride": "allow",
|
||||
"outputProperties": [],
|
||||
"x": 620,
|
||||
"y": 680,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "134433d6e21dab5b",
|
||||
"type": "server-state-changed",
|
||||
|
Reference in New Issue
Block a user