5 Commits

View File

@ -79,6 +79,14 @@
"info": "",
"env": []
},
{
"id": "ce79e27ec84983a9",
"type": "tab",
"label": "Batteries",
"disabled": false,
"info": "",
"env": []
},
{
"id": "458e4c0055c8c533",
"type": "tab",
@ -920,11 +928,12 @@
"88b10efda9e2c047",
"96cf0949902f8572",
"6bbf7df2c43c481e",
"02f922bba32e4c71"
"02f922bba32e4c71",
"ffa5d38853e1360a"
],
"x": 14,
"y": 11.5,
"w": 1252,
"w": 1312,
"h": 809.5
},
{
@ -1243,11 +1252,11 @@
"73078f818abdc6c2",
"2516c6e3146cc851",
"d6e7197427bb4d1b",
"6c1ffa37c98be592",
"4b7ed8ad595ee9cb",
"b7022ac46a70a7d8",
"a64928d7a0b836cf",
"aecc95a3db3369e2"
"aecc95a3db3369e2",
"bd6bdc6ed9aded9d"
],
"x": 34,
"y": 579,
@ -2121,6 +2130,31 @@
"w": 1412,
"h": 302
},
{
"id": "1f3d367ed3e35f1f",
"type": "group",
"z": "ce79e27ec84983a9",
"name": "Doorbell Battery Saver",
"style": {
"label": true
},
"nodes": [
"85f64d70ea1ad38b",
"3762233dfe00d338",
"0c394f2de9bd9917",
"eb4303c234c0f911",
"5173aa5c7adb827a",
"b36a4f453c2a06b2",
"977f5fdca9aaa918",
"42a6971dbcdf2dd7",
"160249109f0b494a",
"090187e752453a53"
],
"x": 74,
"y": 59,
"w": 1292,
"h": 162
},
{
"id": "fba69dfc80829db7",
"type": "junction",
@ -7763,7 +7797,7 @@
"type": "function",
"z": "e44b1e7a8ef7ae1d",
"name": "Processing",
"func": "let tomorrow = msg.tomorrow\nlet today = msg.today\nlet number = {}\nlet 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}",
"func": "let tomorrow = msg.tomorrow\nlet today = msg.today\nlet number = {}\nlet 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\nnode.status({fill:\"green\",shape:\"dot\",text:\"Number \" + number})\n\nif (number == 0) {\n node.send([msg,null])\n} else {\n node.send([null,msg])\n}",
"outputs": 2,
"timeout": "",
"noerr": 0,
@ -11160,7 +11194,7 @@
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"doorbell_lights_restore\",\t \"snapshot_entities\":[\"light.living_room_overhead\",\"light.living_room_led_strip\",\"light.tina_lamp_top\"]\t}",
"data": "{\t \"scene_id\": lightsScene,\t \"snapshot_entities\":[\"light.living_room_overhead\",\"light.living_room_led_strip\",\"light.tina_lamp_top\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
@ -11192,7 +11226,7 @@
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"scene_id\":\"doorbell_adaptive_restore\",\t \"snapshot_entities\":[\"switch.adaptive_lighting_tina_lamp\",\"switch.adaptive_lighting_living_room\"]\t}",
"data": "{\t \"scene_id\": adaptiveScene,\t \"snapshot_entities\":[\"switch.adaptive_lighting_tina_lamp\",\"switch.adaptive_lighting_living_room\"]\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
@ -11365,7 +11399,7 @@
"areaId": [],
"deviceId": [],
"entityId": [
"scene.doorbell_lights_restore"
"scene.{{lightsScene}}"
],
"labelId": [],
"data": "",
@ -11460,7 +11494,7 @@
"areaId": [],
"deviceId": [],
"entityId": [
"scene.doorbell_adaptive_restore"
"scene.{{adaptiveScene}}"
],
"labelId": [],
"data": "",
@ -11569,6 +11603,18 @@
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "lightsScene",
"propertyType": "msg",
"value": "doorbell_lights_restore",
"valueType": "str"
},
{
"property": "adaptiveScene",
"propertyType": "msg",
"value": "doorbell_adaptive_restore",
"valueType": "str"
}
],
"x": 120,
@ -15384,7 +15430,7 @@
"11aabd786c07244f",
"ea5306d6f92d9550",
"d6e7197427bb4d1b",
"6c1ffa37c98be592"
"bd6bdc6ed9aded9d"
]
]
},
@ -15472,7 +15518,7 @@
"11aabd786c07244f",
"ea5306d6f92d9550",
"d6e7197427bb4d1b",
"6c1ffa37c98be592"
"bd6bdc6ed9aded9d"
]
]
},
@ -15532,7 +15578,7 @@
"2516c6e3146cc851",
"ea5306d6f92d9550",
"d6e7197427bb4d1b",
"6c1ffa37c98be592"
"bd6bdc6ed9aded9d"
]
],
"l": false
@ -16389,50 +16435,6 @@
[]
]
},
{
"id": "6c1ffa37c98be592",
"type": "api-current-state",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Heat Allowed",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_boolean.basement_studio_heat_allowed",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 390,
"y": 800,
"wires": [
[
"4b7ed8ad595ee9cb"
],
[]
],
"outputLabels": [
"yes",
"no"
]
},
{
"id": "4b7ed8ad595ee9cb",
"type": "api-call-service",
@ -16697,7 +16699,7 @@
"y": 800,
"wires": [
[
"6c1ffa37c98be592"
"bd6bdc6ed9aded9d"
],
[]
],
@ -17254,6 +17256,28 @@
[]
]
},
{
"id": "bd6bdc6ed9aded9d",
"type": "function",
"z": "47f17992fab9b4f5",
"g": "550e5b2d99316b12",
"name": "Heat Logic",
"func": "const states = global.get('homeassistant.homeAssistant.states')\nconst allowed = states['input_boolean.basement_studio_heat_allowed'].state\nconst outsideTemp = states['weather.iron_nerd_weather_station'].attributes.temperature\nconst todaysHighTemp = states['sensor.todays_high_temp'].state\nconst basementTemp = states['sensor.basement_studio_temperature'].state\n\nlet power = {}\nlet reason = {}\n\nif (todaysHighTemp < 55) {\n power = 'on'\n reason = 'Todays High Temperature'\n} else if (outsideTemp < 40) {\n power = 'on'\n reason = 'Outside Temperature'\n} else if (basementTemp < 64) {\n power = 'on'\n reason = 'Basement Temperature'\n} else {\n power = 'off'\n}\n\nif (allowed === 'on') {\n if (power === 'on') {\n node.status({fill:'green',shape:'dot',text:'Heater Needed: ' + reason})\n node.send(msg,null)\n } else {\n node.status({fill:'red',shape:'ring',text:'Heater Not Needed'})\n node.send(null,msg)\n }\n} else {\n node.status({fill:'red',shape:'ring',text:'Heat Disabled'})\n}\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 800,
"wires": [
[
"4b7ed8ad595ee9cb"
]
],
"icon": "node-red-contrib-huemagic/hue-temperature.svg"
},
{
"id": "091390f43bfeddf5",
"type": "api-call-service",
@ -21743,7 +21767,7 @@
"blockInputOverrides": false,
"domain": "",
"service": "",
"x": 1020,
"x": 1220,
"y": 420,
"wires": [
[]
@ -21841,6 +21865,46 @@
"override_data": "msg",
"x": 820,
"y": 420,
"wires": [
[
"ffa5d38853e1360a"
],
[]
]
},
{
"id": "ffa5d38853e1360a",
"type": "api-current-state",
"z": "72f99805df043603",
"g": "e065b1ed4938b477",
"name": "People Sleeping",
"server": "9e87348d.9c1c48",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.people_sleeping",
"state_type": "str",
"blockInputOverrides": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1020,
"y": 420,
"wires": [
[
"96cf0949902f8572"
@ -22351,6 +22415,363 @@
[]
]
},
{
"id": "85f64d70ea1ad38b",
"type": "server-state-changed",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Battery Low",
"server": "9e87348d.9c1c48",
"version": 6,
"outputs": 2,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"binary_sensor.front_doorbell_battery_plus_low"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": true,
"ignoreCurrentStateUnavailable": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
},
{
"property": "id",
"propertyType": "msg",
"value": "front_doorbell_battery_low",
"valueType": "str"
}
],
"x": 170,
"y": 140,
"wires": [
[
"977f5fdca9aaa918"
],
[
"eb4303c234c0f911"
]
]
},
{
"id": "3762233dfe00d338",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Reduce Snapshots",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"select.front_doorbell_snapshot_mode"
],
"labelId": [],
"data": "{\t \"option\":\"Interval + Ding\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "select",
"service": "select_option",
"x": 630,
"y": 100,
"wires": [
[
"0c394f2de9bd9917"
]
]
},
{
"id": "0c394f2de9bd9917",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Increase Interval",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.front_doorbell_snapshot_interval"
],
"labelId": [],
"data": "{\t \"value\": 600\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "number",
"service": "set_value",
"x": 840,
"y": 100,
"wires": [
[
"b36a4f453c2a06b2"
]
]
},
{
"id": "eb4303c234c0f911",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Increase Snapshots",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "select.select_option",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"select.front_doorbell_snapshot_mode"
],
"labelId": [],
"data": "{\t \"option\":\"All\"\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "select",
"service": "select_option",
"x": 420,
"y": 180,
"wires": [
[
"5173aa5c7adb827a"
]
]
},
{
"id": "5173aa5c7adb827a",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Reduce Interval",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "number.set_value",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"number.front_doorbell_snapshot_interval"
],
"labelId": [],
"data": "{\t \"value\": 300\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "number",
"service": "set_value",
"x": 620,
"y": 180,
"wires": [
[
"160249109f0b494a"
]
]
},
{
"id": "b36a4f453c2a06b2",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Persistent Notification",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "persistent_notification.create",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"title\": title,\t \"message\": message,\t \"notification_id\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "persistent_notification",
"service": "create",
"x": 1060,
"y": 100,
"wires": [
[
"42a6971dbcdf2dd7"
]
]
},
{
"id": "977f5fdca9aaa918",
"type": "change",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Notification Setup",
"rules": [
{
"t": "set",
"p": "title",
"pt": "msg",
"to": "Front Doorbell Battery Low",
"tot": "str"
},
{
"t": "set",
"p": "message",
"pt": "msg",
"to": "The battery in the front doorbell has reached 25% or less. Activating power saving mode. We will reduce snapshots taken until the battery has a chance to charge.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 410,
"y": 100,
"wires": [
[
"3762233dfe00d338"
]
]
},
{
"id": "42a6971dbcdf2dd7",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Text Notify",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\": \"normal\",\t \"who\": \"parents\",\t \"title\": title,\t \"message\": message,\t \"tag\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "script",
"service": "text_notify",
"x": 1270,
"y": 100,
"wires": [
[]
]
},
{
"id": "160249109f0b494a",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Persistent Notification Clear",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "persistent_notification.dismiss",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"notification_id\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "persistent_notification",
"service": "dismiss",
"x": 860,
"y": 180,
"wires": [
[
"090187e752453a53"
]
]
},
{
"id": "090187e752453a53",
"type": "api-call-service",
"z": "ce79e27ec84983a9",
"g": "1f3d367ed3e35f1f",
"name": "Text Notify Clear",
"server": "9e87348d.9c1c48",
"version": 7,
"debugenabled": false,
"action": "script.text_notify",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [],
"labelId": [],
"data": "{\t \"type\": \"alert\",\t \"who\": \"parents\",\t \"message\": \"clear_notification\",\t \"tag\": id\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "script",
"service": "text_notify",
"x": 1100,
"y": 180,
"wires": [
[]
]
},
{
"id": "9256f78107619596",
"type": "ha-time",