Advertisement
dykandDK

HA - NR - Send notification to devices that are not home

Nov 24th, 2020
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.87 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "167fad20.2ea393",
  4.         "type": "ha-get-entities",
  5.         "z": "5ca397bf.911708",
  6.         "server": "3bebce79.1e0962",
  7.         "name": "Get away devices",
  8.         "rules": [
  9.             {
  10.                 "property": "entity_id",
  11.                 "logic": "starts_with",
  12.                 "value": "device_tracker.",
  13.                 "valueType": "str"
  14.             },
  15.             {
  16.                 "property": "state",
  17.                 "logic": "is",
  18.                 "value": "not_home",
  19.                 "valueType": "str"
  20.             },
  21.             {
  22.                 "property": "attributes.source_type",
  23.                 "logic": "is",
  24.                 "value": "gps",
  25.                 "valueType": "str"
  26.             }
  27.         ],
  28.         "output_type": "array",
  29.         "output_empty_results": false,
  30.         "output_location_type": "msg",
  31.         "output_location": "payload",
  32.         "output_results_count": 1,
  33.         "x": 310,
  34.         "y": 520,
  35.         "wires": [
  36.             [
  37.                 "6d57350e.37214c"
  38.             ]
  39.         ]
  40.     },
  41.     {
  42.         "id": "190545ea.c8512a",
  43.         "type": "inject",
  44.         "z": "5ca397bf.911708",
  45.         "name": "timestamp",
  46.         "props": [
  47.             {
  48.                 "p": "payload"
  49.             }
  50.         ],
  51.         "repeat": "3600",
  52.         "crontab": "",
  53.         "once": false,
  54.         "onceDelay": "1",
  55.         "topic": "",
  56.         "payload": "",
  57.         "payloadType": "date",
  58.         "x": 130,
  59.         "y": 520,
  60.         "wires": [
  61.             [
  62.                 "167fad20.2ea393"
  63.             ]
  64.         ]
  65.     },
  66.     {
  67.         "id": "6d57350e.37214c",
  68.         "type": "split",
  69.         "z": "5ca397bf.911708",
  70.         "name": "Split devices",
  71.         "splt": "\\n",
  72.         "spltType": "str",
  73.         "arraySplt": 1,
  74.         "arraySpltType": "len",
  75.         "stream": false,
  76.         "addname": "",
  77.         "x": 490,
  78.         "y": 520,
  79.         "wires": [
  80.             [
  81.                 "1e62548c.20438b"
  82.             ]
  83.         ]
  84.     },
  85.     {
  86.         "id": "1e62548c.20438b",
  87.         "type": "string",
  88.         "z": "5ca397bf.911708",
  89.         "name": "Replace device_tracker",
  90.         "methods": [
  91.             {
  92.                 "name": "replaceAll",
  93.                 "params": [
  94.                     {
  95.                         "type": "str",
  96.                         "value": "device_tracker."
  97.                     },
  98.                     {
  99.                         "type": "str",
  100.                         "value": "mobile_app_"
  101.                     }
  102.                 ]
  103.             }
  104.         ],
  105.         "prop": "payload.entity_id",
  106.         "propout": "payload",
  107.         "object": "msg",
  108.         "objectout": "msg",
  109.         "x": 690,
  110.         "y": 520,
  111.         "wires": [
  112.             [
  113.                 "c4a65d7e.0199f"
  114.             ]
  115.         ]
  116.     },
  117.     {
  118.         "id": "c4a65d7e.0199f",
  119.         "type": "api-call-service",
  120.         "z": "5ca397bf.911708",
  121.         "name": "Send notification",
  122.         "server": "3bebce79.1e0962",
  123.         "version": 1,
  124.         "debugenabled": false,
  125.         "service_domain": "notify",
  126.         "service": "{{payload}}",
  127.         "entityId": "",
  128.         "data": "{\"message\":\"This is a test\"}",
  129.         "dataType": "json",
  130.         "mergecontext": "",
  131.         "output_location": "",
  132.         "output_location_type": "none",
  133.         "mustacheAltTags": false,
  134.         "x": 910,
  135.         "y": 520,
  136.         "wires": [
  137.             []
  138.         ]
  139.     },
  140.     {
  141.         "id": "39962b1c.668e34",
  142.         "type": "comment",
  143.         "z": "5ca397bf.911708",
  144.         "name": "Send notifications to mobile devices that are away",
  145.         "info": "",
  146.         "x": 230,
  147.         "y": 460,
  148.         "wires": []
  149.     },
  150.     {
  151.         "id": "3bebce79.1e0962",
  152.         "type": "server",
  153.         "name": "Home Assistant",
  154.         "addon": true
  155.     }
  156. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement