Node-RED work and bed time flows

Simple flows with one cool feature (IMHO)

First is a basic alarm to start my day at 7AM when I am home

Second actives appropriate scenes based on Mode and mutes/unmutes computer and turns monitors off. This is accomplished my having a widows share mounted on the Node-RED server and using a program called AssistantComputerControl. It simply monitors a directory and executes what it finds there. It is intended to allow voice control via alexa and used IFTTT and drop box. By using node-RED I am able to take IFTTT and dropbox out of the equation allowing for a local only solution.

2 Likes

This looks intereseting. Are you able to post the flow. I'm particuarly interested in the Send commands to ACC nodes. Thanks.

lets see how well this works... Let me know if you do anything cool with ACC

https://assistantcomputercontrol.com/

[
{
	"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",
	"outputs": 1,
	"options": [
		{
			"topic": "7AM weekday",
			"payload": "",
			"type": "str",
			"expression": "0 7 * * 1-5 ",
			"name": "7AM weekday"
		}
	],
	"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
}

]

@pat.richards Can you explain how you put the windows share mounted on the Node-Red server? Thanks I not getting that part of it? I really like that you did this local instead of using Dropbox, Google Drive etc.

@leeonestop I could but it would be better to point you to the guide I used :slight_smile:

I am sure there are folks here who's linux-fu is stronger than mine

@pat.richards Thanks for the info. I'm using a Raspberry PI for my Node Red. What type of computer are you using Ubuntu on. Thanks for the info.

one I built myself its actually running as a VM on proxmox . the base server is a 4 core Intel(R) Atom(TM) CPU C2558 @ 2.40GHz 16bg ram and a small ssd drive I had laying around.
should work on a Pi as well Mounting and AutoMounting Windows Shares on Raspberry Pi | Raspberry Pi Adventures

Hey thanks for the info. Appreciate your help went I look I didn't come across that info that seems much easier than what I was looking at. Thanks again for your help.

@leeonestop happy too many folks here have helped me out (looking at you @april.brandt) just doing my part

let me know if you get it working!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.