Advertisement
dykandDK

HA - NR - Sensor unavailable notification

Mar 22nd, 2021 (edited)
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 5.80 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "347bdd36.8feae2",
  4.         "type": "tab",
  5.         "label": "Unavailable entity notifications",
  6.         "disabled": false,
  7.         "info": ""
  8.     },
  9.     {
  10.         "id": "97691bce.a968d8",
  11.         "type": "comment",
  12.         "z": "347bdd36.8feae2",
  13.         "name": "Alert when sensors are unreachable",
  14.         "info": "",
  15.         "x": 180,
  16.         "y": 70,
  17.         "wires": []
  18.     },
  19.     {
  20.         "id": "e3336f13.9cf0f",
  21.         "type": "template",
  22.         "z": "347bdd36.8feae2",
  23.         "name": "Entity names",
  24.         "field": "payload",
  25.         "fieldType": "msg",
  26.         "format": "handlebars",
  27.         "syntax": "mustache",
  28.         "template": "{{payload.attributes.friendly_name}}",
  29.         "output": "str",
  30.         "x": 700,
  31.         "y": 130,
  32.         "wires": [
  33.             [
  34.                 "82e82bed.e1e218"
  35.             ]
  36.         ]
  37.     },
  38.     {
  39.         "id": "82e82bed.e1e218",
  40.         "type": "join",
  41.         "z": "347bdd36.8feae2",
  42.         "name": "combine msgs",
  43.         "mode": "custom",
  44.         "build": "string",
  45.         "property": "payload",
  46.         "propertyType": "msg",
  47.         "key": "topic",
  48.         "joiner": "[92,110]",
  49.         "joinerType": "bin",
  50.         "accumulate": false,
  51.         "timeout": "",
  52.         "count": "",
  53.         "reduceRight": false,
  54.         "reduceExp": "",
  55.         "reduceInit": "",
  56.         "reduceInitType": "",
  57.         "reduceFixup": "",
  58.         "x": 870,
  59.         "y": 130,
  60.         "wires": [
  61.             [
  62.                 "2b845250.7cb62e",
  63.                 "336c8aa6.3c9096"
  64.             ]
  65.         ]
  66.     },
  67.     {
  68.         "id": "336c8aa6.3c9096",
  69.         "type": "debug",
  70.         "z": "347bdd36.8feae2",
  71.         "name": "",
  72.         "active": true,
  73.         "tosidebar": true,
  74.         "console": false,
  75.         "tostatus": false,
  76.         "complete": "payload",
  77.         "targetType": "msg",
  78.         "statusVal": "",
  79.         "statusType": "auto",
  80.         "x": 1040,
  81.         "y": 90,
  82.         "wires": []
  83.     },
  84.     {
  85.         "id": "b9a480bc.afb1d",
  86.         "type": "ha-get-entities",
  87.         "z": "347bdd36.8feae2",
  88.         "server": "",
  89.         "name": "Get unreachable entities",
  90.         "rules": [
  91.             {
  92.                 "property": "state",
  93.                 "logic": "is",
  94.                 "value": "unavailable",
  95.                 "valueType": "str"
  96.             },
  97.             {
  98.                 "property": "attributes.device_class",
  99.                 "logic": "is_not",
  100.                 "value": "\"\"",
  101.                 "valueType": "str"
  102.             },
  103.             {
  104.                 "property": "attributes.device_class",
  105.                 "logic": "is_not",
  106.                 "value": "timestamp",
  107.                 "valueType": "str"
  108.             }
  109.         ],
  110.         "output_type": "split",
  111.         "output_empty_results": false,
  112.         "output_location_type": "msg",
  113.         "output_location": "payload",
  114.         "output_results_count": 1,
  115.         "x": 500,
  116.         "y": 130,
  117.         "wires": [
  118.             [
  119.                 "e3336f13.9cf0f"
  120.             ]
  121.         ]
  122.     },
  123.     {
  124.         "id": "b5f4c9b1.a365b8",
  125.         "type": "inject",
  126.         "z": "347bdd36.8feae2",
  127.         "name": "Run at 20.30",
  128.         "props": [
  129.             {
  130.                 "p": "payload"
  131.             },
  132.             {
  133.                 "p": "topic",
  134.                 "vt": "str"
  135.             }
  136.         ],
  137.         "repeat": "",
  138.         "crontab": "30 20 * * *",
  139.         "once": false,
  140.         "onceDelay": 0.1,
  141.         "topic": "",
  142.         "payload": "true",
  143.         "payloadType": "bool",
  144.         "x": 140,
  145.         "y": 130,
  146.         "wires": [
  147.             [
  148.                 "19cb70bb.48cb9f"
  149.             ]
  150.         ]
  151.     },
  152.     {
  153.         "id": "2b845250.7cb62e",
  154.         "type": "api-call-service",
  155.         "z": "347bdd36.8feae2",
  156.         "name": "Send notification",
  157.         "server": "",
  158.         "version": 1,
  159.         "debugenabled": false,
  160.         "service_domain": "notify",
  161.         "service": "mobile_app_anders_iphone",
  162.         "entityId": "",
  163.         "data": "{\"message\":\"En eller flere enheder er ikke tilgængelige: \\n\\n {{payload}} \\n\\nKontroller netværksdækning.\"}",
  164.         "dataType": "json",
  165.         "mergecontext": "",
  166.         "output_location": "",
  167.         "output_location_type": "none",
  168.         "mustacheAltTags": false,
  169.         "x": 1050,
  170.         "y": 130,
  171.         "wires": [
  172.             []
  173.         ]
  174.     },
  175.     {
  176.         "id": "8138369e.832568",
  177.         "type": "inject",
  178.         "z": "347bdd36.8feae2",
  179.         "name": "",
  180.         "props": [
  181.             {
  182.                 "p": "payload"
  183.             },
  184.             {
  185.                 "p": "topic",
  186.                 "vt": "str"
  187.             }
  188.         ],
  189.         "repeat": "",
  190.         "crontab": "",
  191.         "once": false,
  192.         "onceDelay": "2",
  193.         "topic": "",
  194.         "payload": "",
  195.         "payloadType": "date",
  196.         "x": 120,
  197.         "y": 180,
  198.         "wires": [
  199.             [
  200.                 "19cb70bb.48cb9f"
  201.             ]
  202.         ]
  203.     },
  204.     {
  205.         "id": "19cb70bb.48cb9f",
  206.         "type": "api-current-state",
  207.         "z": "347bdd36.8feae2",
  208.         "name": "Home?",
  209.         "server": "3bebce79.1e0962",
  210.         "version": 1,
  211.         "outputs": 2,
  212.         "halt_if": "home",
  213.         "halt_if_type": "str",
  214.         "halt_if_compare": "is",
  215.         "override_topic": false,
  216.         "entity_id": "group.alle_personer",
  217.         "state_type": "str",
  218.         "state_location": "payload",
  219.         "override_payload": "msg",
  220.         "entity_location": "data",
  221.         "override_data": "msg",
  222.         "blockInputOverrides": false,
  223.         "x": 310,
  224.         "y": 130,
  225.         "wires": [
  226.             [
  227.                 "b9a480bc.afb1d"
  228.             ],
  229.             []
  230.         ]
  231.     }
  232. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement