|
发表于 2023-3-17 15:07:01
|
显示全部楼层
[{"id":"1ad56e7c.8467f2","type":"server-state-changed","z":"b6b9a1dc.b520b","name":"老妈","server":"22982e1e.8f49c2","entityidfilter":"device_tracker.2","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":110,"y":560,"wires":[["b3f50790.092cd8"]]},{"id":"b3f50790.092cd8","type":"function","z":"b6b9a1dc.b520b","name":"到家推送","func":"var message = "";var subtitle = "";var type ="";var title="";if (msg.payload === 'home') \n{\n type = "到家";\n}\nelse\n{\n type= "离家";\n}\nmsg.payload = {};\nif (flow.get('notify_arrivedhome') === true){\n if(msg.topic==='device_tracker.2')\n {\n message= "老妈"+type ;\n }\n if(msg.topic==='device_tracker.1')\n {\n message= "果果"+type ;\n }\n if(msg.topic==='device_tracker.1')\n {\n message= "老爸"+type ;\n }\n msg.payload.data = {"title":title,"message":message,"data":{"subtitle":subtitle,"push":{"badge":0,"category":"notify_checkfamily"}}};\n return msg; \n}\n\n","outputs":1,"noerr":0,"x":280,"y":620,"wires":[["4c8c01cc.0bed"]],"icon":"node-red/feed.png"},{"id":"4c8c01cc.0bed","type":"api-call-service","z":"b6b9a1dc.b520b","name":"推送提醒","server":"22982e1e.8f49c2","service_domain":"notify","service":"ios_freddy","data":"","mergecontext":"123","output_location":"","output_location_type":"none","x":440,"y":620,"wires":[[]],"inputLabels":["1"]},{"id":"4320af79.708c7","type":"server-state-changed","z":"b6b9a1dc.b520b","name":"老爸","server":"22982e1e.8f49c2","entityidfilter":"device_tracker.1","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":110,"y":620,"wires":[["b3f50790.092cd8"]]},{"id":"3476d93e.bdc136","type":"server-state-changed","z":"b6b9a1dc.b520b","name":"果果","server":"22982e1e.8f49c2","entityidfilter":"device_tracker.1","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":110,"y":680,"wires":[["b3f50790.092cd8"]]},{"id":"22982e1e.8f49c2","type":"server","z":"","name":"Home Assistant"}] |
|