关于通过nr(node-red)控制windows电脑开机和关机的流 (完全是大佬给的现成的东西)

首先声明这是给菜菜菜菜鸟级别的人看的教程 大佬轻拍
因为我作为菜菜鸟的小白 熬了两个美好的夜晚才搞定的东西 希望和我一样的小白少走弯路 几分钟上手省时省力

1,首先下载这个软件http://www.airytec.com/en/switch-off/get.aspx

选择full这个版本

2,安装好后电脑右下角任务栏右键点击这个圆圈圈哈image

选择【放入通知区域】 ------- (这个的作用 是开机自动启动 只是写的有点坑爹 )

然后再右键选择【选项】 进入如下设置界面

3,然后选择这个图片里面的【远程】;点击【编辑网页界面设置】

进去之后勾选这里image

到此软件部分搞定

4, 然后进入windows防火墙界面关闭防火墙

或者把这个软件添加允许image
这一步坑了俺一个晚上时间 :sob: :sob: :sob:

5,最后上大佬给的流 死乞白脸找群里 日文大佬要的哈这是日文大佬给的nrui的流.json (2.6 KB) 这个是我用门磁改的开关的流.json (3.1 KB)
导入流后 把节点里的ip改成直接电脑的ip,然后可以愉快的关机了 :grinning:

6 ,开机可以bios设置来电开机(这个设置最简单,本人本着穷人节能的原则选这个方案),也可以通过网络唤醒开机(这个就有点设置麻烦,我也没研究)

第一次发帖 排版太差 见谅

[{"id":"bf8c7400.ea37d8","type":"subflow","name":"电脑控制","info":"","category":"","in":[{"x":60,"y":200,"wires":[{"id":"9eaa29e2.7d6148"}]}],"out":[{"x":800,"y":200,"wires":[{"id":"65ec798b.232838","port":0},{"id":"1a425be8.7fbf44","port":0},{"id":"c8e1336e.d57c7","port":0},{"id":"453c332f.f9294c","port":0},{"id":"72334e01.69b4","port":0},{"id":"37bd5968.748846","port":0},{"id":"dc282531.eaf2a8","port":0},{"id":"9f4cffe4.50ee3","port":0}]}],"env":[]},{"id":"65ec798b.232838","type":"exec","z":"bf8c7400.ea37d8","command":"curl -X GET http://192.168.123.3:8000/?action=System.Shutdown","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"电脑关机","x":520,"y":80,"wires":[[],[],[]]},{"id":"1a425be8.7fbf44","type":"exec","z":"bf8c7400.ea37d8","command":"curl -X GET http://192.168.123.3:8000/?action=System.Restart","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"电脑重启","x":521,"y":160,"wires":[[],[],[]]},{"id":"c8e1336e.d57c7","type":"exec","z":"bf8c7400.ea37d8","command":"curl -X GET http://192.168.123.3:8000/?action=System.Sleep","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"电脑睡眠","x":521,"y":240,"wires":[[],[],[]]},{"id":"453c332f.f9294c","type":"exec","z":"bf8c7400.ea37d8","command":"curl -X GET http://192.168.123.3:8000/?action=System.Dormancy","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"电脑休眠","x":521,"y":320,"wires":[[],[],[]]},{"id":"9eaa29e2.7d6148","type":"switch","z":"bf8c7400.ea37d8","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"0/On","vt":"str"},{"t":"eq","v":"1/On","vt":"str"},{"t":"eq","v":"2/On","vt":"str"},{"t":"eq","v":"3/On","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":190,"y":200,"wires":[["65ec798b.232838","6070b854.bc1218"],["1a425be8.7fbf44","e41b81ec.cce18"],["c8e1336e.d57c7","7376d342.2d4d4c"],["453c332f.f9294c","b29cf03b.d206b"]]},{"id":"72334e01.69b4","type":"change","z":"bf8c7400.ea37d8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":380,"wires":[[]]},{"id":"6070b854.bc1218","type":"delay","z":"bf8c7400.ea37d8","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":380,"wires":[["72334e01.69b4"]]},{"id":"e41b81ec.cce18","type":"delay","z":"bf8c7400.ea37d8","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":420,"wires":[["37bd5968.748846"]]},{"id":"37bd5968.748846","type":"change","z":"bf8c7400.ea37d8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":420,"wires":[[]]},{"id":"7376d342.2d4d4c","type":"delay","z":"bf8c7400.ea37d8","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":460,"wires":[["dc282531.eaf2a8"]]},{"id":"dc282531.eaf2a8","type":"change","z":"bf8c7400.ea37d8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":460,"wires":[[]]},{"id":"b29cf03b.d206b","type":"delay","z":"bf8c7400.ea37d8","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":500,"wires":[["9f4cffe4.50ee3"]]},{"id":"9f4cffe4.50ee3","type":"change","z":"bf8c7400.ea37d8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":500,"wires":[[]]},{"id":"f1f0414d.0798f","type":"redmatic-homekit-universal","z":"bc05d6c9.ac4638","bridgeConfig":"2816d8d3.7b3a88","name":"电脑","services":[{"subtype":"0","service":"Outlet","name":"关闭电脑"},{"subtype":"1","service":"Outlet","name":"重启电脑"},{"subtype":"2","service":"Outlet","name":"电脑睡眠"},{"subtype":"3","service":"Outlet","name":"电脑休眠"}],"x":90,"y":760,"wires":[["ee4957d8.322328"]]},{"id":"ee4957d8.322328","type":"subflow:bf8c7400.ea37d8","z":"bc05d6c9.ac4638","name":"电脑控制","env":[],"x":220,"y":760,"wires":[["f1f0414d.0798f"]]},{"id":"2816d8d3.7b3a88","type":"redmatic-homekit-bridge","z":"","name":"电脑控制","username":"CC:22:3D:29:A6:EF","pincode":"556-35-274","port":"51847"}]

哎 这是homekit的

?没有homekit的 没苹果设备 只有mqtt

好东西!感谢!!!

我都只做开机,不做关机,玩的正嗨总有黑手突然给你熄火,太难受了,这个用HA就可以实现了,没这么复杂,然后HA会接入HK的时候就会自动出现两个开关

switch:
 - platform: wake_on_lan
   mac: "4C-ED-FB-BB-DF-CB"
   name: "desktop"
   host: 192.168.1.223
 - platform: wake_on_lan
   mac: "4C-CC-6A-7F-5B-04"
   name: "laptop"
   host: 192.168.1.224