Node-Red Flow Samples/Sharing

Title Office scenes with PC control

Summary -
Part 1 - Work Alarm turns mode to "work Time" at 7:00AM If I am home and if it's a weekday.
Part 2 - Office Scenes when mode changes turn on/ off devices, mute/unmute computer and turn on/off computer monitors. This uses https://assistantcomputercontrol.com/ on a windows machine bypassing IFTT and dropbox by writing directly to a windows share.

discussed here Node-RED work and bed time flows

flow

[
{
"id": "16c8a7d5.e07098",
"type": "tab",
"label": "Week Day Alarm",
"disabled": false,
"info": ""
},
{
"id": "1ed910a2.658ddf",
"type": "cronplus",
"z": "16c8a7d5.e07098",
"name": "weekday 7AM",
"outputField": "payload",
"timeZone": "America/New_York",
"persistDynamic": false,
"commandResponseMsgOutput": "output1",
"outputs": 1,
"options": [
{
"name": "7AM weekday",
"topic": "7AM weekday",
"payloadType": "str",
"payload": "",
"expressionType": "cron",
"expression": "0 7 * * 1-5 ",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 120,
"y": 280,
"wires": [
[
"9457d1a7.e9a53"
]
]
},
{
"id": "9457d1a7.e9a53",
"type": "hubitat device",
"z": "16c8a7d5.e07098",
"name": "Pat Richards’s iPhone XS max",
"server": "6b0c5f4f.a782d",
"deviceId": "8",
"attribute": "presence",
"sendEvent": true,
"x": 390,
"y": 280,
"wires": [
[
"eeecdf71.ac468"
]
],
"info": "If Pat's home"
},
{
"id": "eeecdf71.ac468",
"type": "switch",
"z": "16c8a7d5.e07098",
"name": "if present",
"property": "payload.currentValue",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "present",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 1,
"x": 650,
"y": 280,
"wires": [
[
"a1dc5328.f6f7b"
]
]
},
{
"id": "a1dc5328.f6f7b",
"type": "hubitat mode-setter",
"z": "16c8a7d5.e07098",
"name": "Set WorkTime",
"server": "6b0c5f4f.a782d",
"modeId": "5",
"x": 860,
"y": 280,
"wires": [
[]
]
},
{
"id": "fb8a7795.755618",
"type": "hubitat mode",
"z": "16c8a7d5.e07098",
"name": "",
"server": "6b0c5f4f.a782d",
"sendEvent": true,
"x": 80,
"y": 440,
"wires": [
[
"3c2864af.26696c"
]
]
},
{
"id": "3c2864af.26696c",
"type": "switch",
"z": "16c8a7d5.e07098",
"name": "",
"property": "payload.value",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Work Time",
"vt": "str"
},
{
"t": "eq",
"v": "Bed time",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 210,
"y": 440,
"wires": [
[
"2ac28f0b.a1b1b"
],
[
"172b1b3a.ba57b5"
]
]
},
{
"id": "2ac28f0b.a1b1b",
"type": "hubitat command",
"z": "16c8a7d5.e07098",
"name": "Activate Worktime Scene",
"server": "6b0c5f4f.a782d",
"deviceId": "17",
"command": "on",
"commandArgs": "",
"x": 410,
"y": 360,
"wires": [
[
"1ebd0a36.e33af6"
]
]
},
{
"id": "172b1b3a.ba57b5",
"type": "hubitat command",
"z": "16c8a7d5.e07098",
"name": "Actvate Bedtime Scene",
"server": "6b0c5f4f.a782d",
"deviceId": "18",
"command": "on",
"commandArgs": "",
"x": 410,
"y": 480,
"wires": [
[
"5109eb60.350d44"
]
]
},
{
"id": "88df61cd.48dd1",
"type": "file",
"z": "16c8a7d5.e07098",
"name": "Send command to ACC",
"filename": "/mnt/ACC/mute.txt",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 870,
"y": 360,
"wires": [
[
"1f0bffc.264b7"
]
]
},
{
"id": "1ebd0a36.e33af6",
"type": "change",
"z": "16c8a7d5.e07098",
"name": "unmute command",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "mute:false",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 360,
"wires": [
[
"88df61cd.48dd1"
]
]
},
{
"id": "5109eb60.350d44",
"type": "change",
"z": "16c8a7d5.e07098",
"name": "mute command",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "mute:true",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 480,
"wires": [
[
"9af79771.648408"
]
]
},
{
"id": "9af79771.648408",
"type": "file",
"z": "16c8a7d5.e07098",
"name": "Send command to ACC",
"filename": "/mnt/ACC/mute.txt",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 870,
"y": 480,
"wires": [
[
"9466b2ed.4dc53"
]
]
},
{
"id": "86b1c8ae.7f64b8",
"type": "file",
"z": "16c8a7d5.e07098",
"name": "Send command to ACC",
"filename": "/mnt/ACC/run.txt",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 870,
"y": 540,
"wires": [
[]
]
},
{
"id": "9466b2ed.4dc53",
"type": "change",
"z": "16c8a7d5.e07098",
"name": "Monitors off",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "open:c:\scratch\screenoff 2.exe",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 630,
"y": 540,
"wires": [
[
"86b1c8ae.7f64b8"
]
]
},
{
"id": "1f0bffc.264b7",
"type": "change",
"z": "16c8a7d5.e07098",
"name": "Monitors on",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "key_shortcut:SPACE",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 630,
"y": 420,
"wires": [
[
"463a73a0.22883c"
]
]
},
{
"id": "463a73a0.22883c",
"type": "file",
"z": "16c8a7d5.e07098",
"name": "Send command to ACC",
"filename": "/mnt/ACC/space.txt",
"appendNewline": true,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 870,
"y": 420,
"wires": [
[]
]
},
{
"id": "6b0c5f4f.a782d",
"type": "hubitat config",
"z": "",
"name": "",
"usetls": false,
"host": "192.168.1.74",
"port": "80",
"appId": "45",
"nodeRedServer": "http://192.168.1.74:1880",
"webhookPath": "/hubitat/webhook",
"autoRefresh": true,
"useWebsocket": true
}
]

3 Likes