[{"id":"fa9df4be7b0c093c","type":"tab","label":"电脑开关机","disabled":false,"info":"","env":[]},{"id":"25988d07616c7974","type":"wake on lan","z":"fa9df4be7b0c093c","mac":"","host":"192.168.1.255","udpport":9,"numpackets":3,"interval":100,"name":"WOL开机","x":980,"y":320,"wires":[]},{"id":"c7ae589685a1b42e","type":"aliyun-living","z":"fa9df4be7b0c093c","name":"阿里飞燕电脑开关","width":160,"DeviceName":"","ProductKey":"","DeviceSecret":"","x":610,"y":360,"wires":[["616ece5f3b3891ad"]]},{"id":"42d4434a.11da6c","type":"debug","z":"fa9df4be7b0c093c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1190,"y":340,"wires":[]},{"id":"c81072df.ec5e2","type":"inject","z":"fa9df4be7b0c093c","name":"测试开","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{"powerstate":1}","payloadType":"json","x":350,"y":460,"wires":[["c7ae589685a1b42e"]]},{"id":"a67a9b70.d27558","type":"inject","z":"fa9df4be7b0c093c","name":"测试关","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{"powerstate":0}","payloadType":"json","x":350,"y":500,"wires":[["c7ae589685a1b42e"]]},{"id":"616ece5f3b3891ad","type":"switch","z":"fa9df4be7b0c093c","name":"开关指令识别","property":"payload.powerstate","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":800,"y":360,"wires":[["25988d07616c7974","42d4434a.11da6c"],["55477420cb319d53"]]},{"id":"5426c1246b7877ac","type":"ping","z":"fa9df4be7b0c093c","protocol":"Automatic","mode":"timed","name":"Ping取电脑状态","host":"192.168.1.9","timer":"10","inputs":0,"x":100,"y":360,"wires":[["3e7fc0b99a98d438"]]},{"id":"3e7fc0b99a98d438","type":"switch","z":"fa9df4be7b0c093c","name":"Ping值转换","property":"payload","propertyType":"msg","rules":[{"t":"istype","v":"number","vt":"number"},{"t":"istype","v":"boolean","vt":"boolean"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":360,"wires":[["d5b1914f422fd890"],["f0a16b3f28e340f4"]]},{"id":"d5b1914f422fd890","type":"change","z":"fa9df4be7b0c093c","name":"已开启","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"RunningState":1}","tot":"json"},{"t":"set","p":"enable","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":340,"wires":[["c7ae589685a1b42e","7eaab5c011838107"]]},{"id":"f0a16b3f28e340f4","type":"change","z":"fa9df4be7b0c093c","name":"已关闭","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"RunningState":0}","tot":"json"},{"t":"set","p":"enable","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":380,"wires":[["c7ae589685a1b42e","7eaab5c011838107"]]},{"id":"7d2697e38ca9ca8d","type":"inject","z":"fa9df4be7b0c093c","name":"测试状态开","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{"RunningState":1}","payloadType":"json","x":360,"y":540,"wires":[["c7ae589685a1b42e"]]},{"id":"4d1d6d8992c7a7bc","type":"inject","z":"fa9df4be7b0c093c","name":"测试状态关","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{"RunningState":0}","payloadType":"json","x":360,"y":580,"wires":[["c7ae589685a1b42e"]]},{"id":"55477420cb319d53","type":"exec","z":"fa9df4be7b0c093c","command":"net rpc shutdown -I 192.168.1.99 address -U 用户名%密码","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"关机指令","x":980,"y":380,"wires":[["42d4434a.11da6c"],["42d4434a.11da6c"],["42d4434a.11da6c"]]},{"id":"7eaab5c011838107","type":"ha-entity","z":"fa9df4be7b0c093c","name":"HA电脑开关","server":"a487525207434812","version":2,"debugenabled":false,"outputs":2,"entityType":"switch","config":[{"property":"name","value":"电脑"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:desktop-classic"},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":true,"outputPayload":"activate","outputPayloadType":"str","x":590,"y":260,"wires":[["25988d07616c7974"],["55477420cb319d53"]]},{"id":"ccfc6bcdabe6b91d","type":"comment","z":"fa9df4be7b0c093c","name":"用NodeRED创建一个开关,加入到HA里","info":"","x":670,"y":180,"wires":[]},{"id":"1a7af30cd7cad950","type":"comment","z":"fa9df4be7b0c093c","name":"网络-Ping","info":"","x":100,"y":320,"wires":[]},{"id":"38a803ad326d4d1b","type":"comment","z":"fa9df4be7b0c093c","name":"switch","info":"","x":270,"y":320,"wires":[]},{"id":"8c76cc39517d64d9","type":"comment","z":"fa9df4be7b0c093c","name":"change","info":"","x":410,"y":300,"wires":[]},{"id":"316d8dde395723f8","type":"comment","z":"fa9df4be7b0c093c","name":"entity","info":"","x":570,"y":220,"wires":[]},{"id":"3c95a89064198ef9","type":"comment","z":"fa9df4be7b0c093c","name":"aliyun - living","info":"","x":590,"y":320,"wires":[]},{"id":"07817bb9158fa13b","type":"comment","z":"fa9df4be7b0c093c","name":"switch","info":"","x":770,"y":400,"wires":[]},{"id":"f63dc50a6039afd9","type":"comment","z":"fa9df4be7b0c093c","name":"wake on lan","info":"","x":990,"y":280,"wires":[]},{"id":"7c8e31bf0ce00533","type":"comment","z":"fa9df4be7b0c093c","name":"exec","info":"","x":970,"y":420,"wires":[]},{"id":"997e7426b850c73b","type":"comment","z":"fa9df4be7b0c093c","name":"inject","info":"","x":330,"y":620,"wires":[]},{"id":"60b5e3b8a5813076","type":"comment","z":"fa9df4be7b0c093c","name":"debug","info":"","x":1170,"y":300,"wires":[]},{"id":"a487525207434812","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]