Hi, ich habe mir einen kleinen Flow für meinen Desktop PC(windows 10 x64 Pro) erstellt und wollte den mit euch teilen. Mit diesen lässt sich euer PC via homee an und ausschalten.
Zuerst habe ich auf dem Raspberry Samba installiert.
sudo apt-get install samba-common
Danach in Node Red das WOL und Ping Node installiert.
Auf euren Rechner muss im Bios (abhängig vom Bios) WOL für eure Netzwerkkarte aktiviert sein.
Desweiteren ruft ihr in WIN 10 den service.msc auf.
Dort aktiviert ihr Remotedesktopdienste auf Automatisch, sowie Remoteregistrierung.
Dann muss in der Police der User dazu berechtigt werden(ihr könnt auch extra dafür einen anlegen)
secpol.msc aufrufen und in Lokale Richtlinien->Zuweisung von Benutzerrechten->Anmelden über Remotedestopdienste zulassen - Hier tragt ihr den gewünschten Nutzer ein.
In der Registry muss ebenfalls etwas geändert werden.
regedit.exe als Admin öffen.
HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System Neuen Eintrag DWORD(32) mit den Namen “LocalAccountTokenFilterPolicy” mit dem Wert “1”.
Konsole öffnen als Admin.
cmd.exe ->
sc config RemoteRegistry start= auto
sc start RemoteRegistry
Zum Schluss mein Flow in Node Red etwas abändern, wie z.B die IP+ MAC Adresse eures PC’s im Ping-Node und WOL-Node, und die NodeID + AttriID, im EXEC Node(Shutdown) muss dann eure IP wieder rein + euer Benutzername+Passwort.
Flow:
[
{
“id”: “9c81ffde.28cf2”,
“type”: “tab”,
“label”: “Forum”,
“disabled”: false,
“info”: “”
},
{
“id”: “3a128795.690328”,
“type”: “inject”,
“z”: “9c81ffde.28cf2”,
“name”: “Trigger alle 3min”,
“topic”: “”,
“payload”: “”,
“payloadType”: “date”,
“repeat”: “180”,
“crontab”: “”,
“once”: true,
“onceDelay”: “”,
“x”: 203,
“y”: 120,
“wires”: [
[
“838a53d3.cb624”
]
]
},
{
“id”: “838a53d3.cb624”,
“type”: “adv ping”,
“z”: “9c81ffde.28cf2”,
“name”: “Desktop PC”,
“host”: “192.168.X.XX”,
“x”: 344.8626174926758,
“y”: 182.95420837402344,
“wires”: [
[
“fa56ce45.07283”,
“1952e535.b02cab”
]
],
“icon”: “node-red-node-wol/onoff.png”
},
{
“id”: “f22ad497.728d98”,
“type”: “wemo out”,
“z”: “9c81ffde.28cf2”,
“name”: “Desktop PC”,
“device”: “587d0142.94f72”,
“label”: “Desktop PC”,
“x”: 1292.8626174926758,
“y”: 183.95420837402344,
“wires”: [],
“icon”: “node-red/leveldb.png”
},
{
“id”: “c912e571.9ba2c8”,
“type”: “wemo-emulator”,
“z”: “9c81ffde.28cf2”,
“name”: “Desktop PC”,
“friendlyName”: “Desktop PC”,
“serial”: “10300”,
“port”: “40001”,
“onTopic”: “switch/hir”,
“onPayload”: “on”,
“offTopic”: “switch/hir”,
“offPayload”: “off”,
“x”: 168.0948257446289,
“y”: 443.672456741333,
“wires”: [
[
“308f2418.3d818c”,
“7e7cc497.7c701c”
]
],
“icon”: “node-red/leveldb.png”
},
{
“id”: “308f2418.3d818c”,
“type”: “function”,
“z”: “9c81ffde.28cf2”,
“name”: “Prüfen des Zustandes Desktop PC”,
“func”: “var nodeid = 37; // node ID in homee vom Wemo\nvar attributid = 271; // attribut ID in homee vom Wemo\nif (msg.payload.on === false)\n{return {payload: “PUT:/nodes/”+nodeid+”/attributes/"+attributid+"?target_value=0"}}\nif (msg.payload.on === true)\n{return {payload: “PUT:/nodes/”+nodeid+"/attributes/"+attributid+"?target_value=1"}}\n",
“outputs”: 1,
“noerr”: 0,
“x”: 498.8626174926758,
“y”: 448.2875213623047,
“wires”: [
[
“b734e29d.9b899”
]
]
},
{
“id”: “b734e29d.9b899”,
“type”: “homee”,
“z”: “9c81ffde.28cf2”,
“name”: “becksmau”,
“host”: “192.168.2.100”,
“x”: 809.8626174926758,
“y”: 448.2875213623047,
“wires”: [
[
“e65e90c3.e3cce”
]
]
},
{
“id”: “e65e90c3.e3cce”,
“type”: “debug”,
“z”: “9c81ffde.28cf2”,
“name”: “Desktop PC”,
“active”: false,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“targetType”: “msg”,
“x”: 1019.8626174926758,
“y”: 448.2875213623047,
“wires”: []
},
{
“id”: “3022f6c3.61352a”,
“type”: “inject”,
“z”: “9c81ffde.28cf2”,
“name”: “Testbutton”,
“topic”: “”,
“payload”: “”,
“payloadType”: “date”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 217.65530395507812,
“y”: 258.0297088623047,
“wires”: [
[
“838a53d3.cb624”
]
]
},
{
“id”: “9df06697.7ae6d8”,
“type”: “switch”,
“z”: “9c81ffde.28cf2”,
“name”: “Desktop PC aus”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “false”,
“vt”: “str”
},
{
“t”: “neq”,
“v”: “false”,
“vt”: “str”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 2,
“x”: 772.8626174926758,
“y”: 185.95420837402344,
“wires”: [
[
“f91a368a.532fe8”
],
[
“21cc2b19.1c0ed4”
]
]
},
{
“id”: “21cc2b19.1c0ed4”,
“type”: “change”,
“z”: “9c81ffde.28cf2”,
“name”: “Set Desktop PC on”,
“rules”: [
{
“t”: “set”,
“p”: “payload”,
“pt”: “msg”,
“to”: “true”,
“tot”: “bool”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 1035.8626174926758,
“y”: 218.95420837402344,
“wires”: [
[
“f22ad497.728d98”
]
]
},
{
“id”: “f91a368a.532fe8”,
“type”: “change”,
“z”: “9c81ffde.28cf2”,
“name”: “Set Desktop PC off”,
“rules”: [
{
“t”: “set”,
“p”: “payload”,
“pt”: “msg”,
“to”: “false”,
“tot”: “bool”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 1033.8626174926758,
“y”: 145.95420837402344,
“wires”: [
[
“f22ad497.728d98”
]
]
},
{
“id”: “fa56ce45.07283”,
“type”: “debug”,
“z”: “9c81ffde.28cf2”,
“name”: “Ping”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“targetType”: “msg”,
“x”: 582.8626174926758,
“y”: 275.95420837402344,
“wires”: []
},
{
“id”: “f0c5efe7.21677”,
“type”: “inject”,
“z”: “9c81ffde.28cf2”,
“name”: “”,
“topic”: “”,
“payload”: “false”,
“payloadType”: “bool”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 1049.8626174926758,
“y”: 293.95420837402344,
“wires”: [
[
“f22ad497.728d98”
]
]
},
{
“id”: “f06e05f6.09d438”,
“type”: “inject”,
“z”: “9c81ffde.28cf2”,
“name”: “true”,
“topic”: “”,
“payload”: “true”,
“payloadType”: “bool”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 1053.8626174926758,
“y”: 343.95420837402344,
“wires”: [
[
“f22ad497.728d98”
]
]
},
{
“id”: “1952e535.b02cab”,
“type”: “change”,
“z”: “9c81ffde.28cf2”,
“name”: “Changer”,
“rules”: [
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “false”,
“fromt”: “bool”,
“to”: “false”,
“tot”: “str”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 561.8626174926758,
“y”: 185.95420837402344,
“wires”: [
[
“9df06697.7ae6d8”
]
]
},
{
“id”: “85c49b6f.0c5f28”,
“type”: “wake on lan”,
“z”: “9c81ffde.28cf2”,
“mac”: “”,
“host”: “192.168.2.255”,
“name”: “becks-PC”,
“x”: 868.0130081176758,
“y”: 638.9308929443359,
“wires”: []
},
{
“id”: “92b13679.c26858”,
“type”: “inject”,
“z”: “9c81ffde.28cf2”,
“name”: “”,
“topic”: “”,
“payload”: “”,
“payloadType”: “date”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 593.8626174926758,
“y”: 561.9542083740234,
“wires”: [
[]
]
},
{
“id”: “95bbff06.06f71”,
“type”: “exec”,
“z”: “9c81ffde.28cf2”,
“command”: " sudo net rpc shutdown -f -t 0 -I 192.168.X.XX -U Benutzer%Passwort",
“addpay”: true,
“append”: “”,
“useSpawn”: “false”,
“timer”: “”,
“oldrc”: false,
“name”: “Shutdown”,
“x”: 871.8458023071289,
“y”: 713.2084197998047,
“wires”: [
[],
[],
[]
]
},
{
“id”: “a0ba574f.c080c8”,
“type”: “switch”,
“z”: “9c81ffde.28cf2”,
“name”: “on”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “on”,
“vt”: “str”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 1,
“x”: 701.0543899536133,
“y”: 638.3845062255859,
“wires”: [
[
“85c49b6f.0c5f28”
]
]
},
{
“id”: “7e7cc497.7c701c”,
“type”: “rbe”,
“z”: “9c81ffde.28cf2”,
“name”: “”,
“func”: “rbe”,
“gap”: “”,
“start”: “”,
“inout”: “out”,
“property”: “payload”,
“x”: 520.5927429199219,
“y”: 638.4918384552002,
“wires”: [
[
“a0ba574f.c080c8”,
“99eb668e.c148e8”
]
]
},
{
“id”: “99eb668e.c148e8”,
“type”: “switch”,
“z”: “9c81ffde.28cf2”,
“name”: “off”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “off”,
“vt”: “str”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 1,
“x”: 702.3626174926758,
“y”: 712.9542083740234,
“wires”: [
[
“95bbff06.06f71”
]
]
},
{
“id”: “587d0142.94f72”,
“type”: “wemo-dev”,
“z”: “”,
“device”: “10300”,
“name”: “Desktop PC”
}
]