Advertisement
dykandDK

HA - NR - Below zero at night automation example

Nov 4th, 2021
1,543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 10.83 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "65b4280152d21b71",
  4.         "type": "tab",
  5.         "label": "Below zero Example",
  6.         "disabled": false,
  7.         "info": "## **Flow for night temperatures below zero**\n**By Anders Lukic**\n\n---\n<br>\n\n---\n\n### **Purpose and functionality**\n\n---\n\n\nThis flow include automations that:\n\n - Sends an actionable notification if outside temperature has been below zero during night\n - Ability to start car defrost or send reminder later\n \n---\n### **Requirements**\n---\nThis flow requires the following additional configuration to work:\n\n* input_boolean to toogle state when outside temperature is below zero during night"
  8.     },
  9.     {
  10.         "id": "6fb64678b8daaadf",
  11.         "type": "server-state-changed",
  12.         "z": "65b4280152d21b71",
  13.         "name": "Temp. below zero?",
  14.         "server": "3bebce79.1e0962",
  15.         "version": 1,
  16.         "exposeToHomeAssistant": false,
  17.         "haConfig": [
  18.             {
  19.                 "property": "name",
  20.                 "value": ""
  21.             },
  22.             {
  23.                 "property": "icon",
  24.                 "value": ""
  25.             }
  26.         ],
  27.         "entityidfilter": "sensor.netatmo_weather_home_ude_temperature",
  28.         "entityidfiltertype": "exact",
  29.         "outputinitially": false,
  30.         "state_type": "str",
  31.         "haltifstate": "0",
  32.         "halt_if_type": "num",
  33.         "halt_if_compare": "lt",
  34.         "outputs": 2,
  35.         "output_only_on_state_change": true,
  36.         "for": "60",
  37.         "forType": "num",
  38.         "forUnits": "minutes",
  39.         "ignorePrevStateNull": false,
  40.         "ignorePrevStateUnknown": false,
  41.         "ignorePrevStateUnavailable": false,
  42.         "ignoreCurrentStateUnknown": false,
  43.         "ignoreCurrentStateUnavailable": false,
  44.         "x": 120,
  45.         "y": 70,
  46.         "wires": [
  47.             [
  48.                 "75365d115fdf937f"
  49.             ],
  50.             []
  51.         ]
  52.     },
  53.     {
  54.         "id": "6dd6c29e5dbcc315",
  55.         "type": "api-call-service",
  56.         "z": "65b4280152d21b71",
  57.         "name": "Turn on boolean",
  58.         "server": "3bebce79.1e0962",
  59.         "version": 1,
  60.         "debugenabled": false,
  61.         "service_domain": "input_boolean",
  62.         "service": "turn_on",
  63.         "entityId": "input_boolean.below_zero_at_night",
  64.         "data": "",
  65.         "dataType": "json",
  66.         "mergecontext": "",
  67.         "output_location": "",
  68.         "output_location_type": "none",
  69.         "mustacheAltTags": false,
  70.         "x": 630,
  71.         "y": 70,
  72.         "wires": [
  73.             []
  74.         ]
  75.     },
  76.     {
  77.         "id": "75365d115fdf937f",
  78.         "type": "time-range-switch",
  79.         "z": "65b4280152d21b71",
  80.         "name": "Night?",
  81.         "lat": "",
  82.         "lon": "",
  83.         "startTime": "22:00",
  84.         "endTime": "22:00",
  85.         "startOffset": 0,
  86.         "endOffset": "08:00",
  87.         "x": 330,
  88.         "y": 70,
  89.         "wires": [
  90.             [
  91.                 "6dd6c29e5dbcc315"
  92.             ],
  93.             []
  94.         ]
  95.     },
  96.     {
  97.         "id": "629a90632325d690",
  98.         "type": "inject",
  99.         "z": "65b4280152d21b71",
  100.         "name": "Weekdays at 7.00",
  101.         "props": [
  102.             {
  103.                 "p": "payload"
  104.             },
  105.             {
  106.                 "p": "topic",
  107.                 "vt": "str"
  108.             }
  109.         ],
  110.         "repeat": "",
  111.         "crontab": "00 07 * * 1,2,3,4,5",
  112.         "once": false,
  113.         "onceDelay": 0.1,
  114.         "topic": "",
  115.         "payloadType": "date",
  116.         "x": 120,
  117.         "y": 190,
  118.         "wires": [
  119.             [
  120.                 "d3506e778fa2c5dd"
  121.             ]
  122.         ]
  123.     },
  124.     {
  125.         "id": "0ed6e7f5240ab037",
  126.         "type": "inject",
  127.         "z": "65b4280152d21b71",
  128.         "name": "Weekends at 9.00",
  129.         "props": [
  130.             {
  131.                 "p": "payload"
  132.             },
  133.             {
  134.                 "p": "topic",
  135.                 "vt": "str"
  136.             }
  137.         ],
  138.         "repeat": "",
  139.         "crontab": "00 09 * * 6,0",
  140.         "once": false,
  141.         "onceDelay": 0.1,
  142.         "topic": "",
  143.         "payloadType": "date",
  144.         "x": 120,
  145.         "y": 240,
  146.         "wires": [
  147.             [
  148.                 "d3506e778fa2c5dd"
  149.             ]
  150.         ]
  151.     },
  152.     {
  153.         "id": "d3506e778fa2c5dd",
  154.         "type": "api-current-state",
  155.         "z": "65b4280152d21b71",
  156.         "name": "Below zero during night?",
  157.         "server": "3bebce79.1e0962",
  158.         "version": 1,
  159.         "outputs": 2,
  160.         "halt_if": "on",
  161.         "halt_if_type": "str",
  162.         "halt_if_compare": "is",
  163.         "override_topic": false,
  164.         "entity_id": "input_boolean.below_zero_at_night",
  165.         "state_type": "str",
  166.         "state_location": "payload",
  167.         "override_payload": "msg",
  168.         "entity_location": "data",
  169.         "override_data": "msg",
  170.         "blockInputOverrides": false,
  171.         "x": 390,
  172.         "y": 220,
  173.         "wires": [
  174.             [
  175.                 "d10efe29357ba15d",
  176.                 "4c32ca0623407f77"
  177.             ],
  178.             []
  179.         ]
  180.     },
  181.     {
  182.         "id": "d10efe29357ba15d",
  183.         "type": "api-call-service",
  184.         "z": "65b4280152d21b71",
  185.         "name": "Turn off boolean",
  186.         "server": "3bebce79.1e0962",
  187.         "version": 1,
  188.         "debugenabled": false,
  189.         "service_domain": "input_boolean",
  190.         "service": "turn_off",
  191.         "entityId": "input_boolean.below_zero_at_night",
  192.         "data": "",
  193.         "dataType": "json",
  194.         "mergecontext": "",
  195.         "output_location": "",
  196.         "output_location_type": "none",
  197.         "mustacheAltTags": false,
  198.         "x": 630,
  199.         "y": 180,
  200.         "wires": [
  201.             []
  202.         ]
  203.     },
  204.     {
  205.         "id": "470c242a24f346f1",
  206.         "type": "api-call-service",
  207.         "z": "65b4280152d21b71",
  208.         "name": "Notification - temp < 0",
  209.         "server": "3bebce79.1e0962",
  210.         "version": 1,
  211.         "debugenabled": false,
  212.         "service_domain": "notify",
  213.         "service": "mobile_app_my_iphone",
  214.         "entityId": "",
  215.         "data": "{\"message\":\"Det har været frostvejr i nat. Er der frost på bilen?\",\"title\":\"Advarsel om nattefrost\",\"data\":{\"actions\":[{\"action\":\"START_DEFROST\",\"title\":\"Ja - start opvarmning af bil\"},{\"action\":\"REMIND_LATER_DEFROST\",\"title\":\"Spørg mig igen senere\"}],\"attachment\":{\"content-type\":\"jpeg\",\"image\":\"https://[HA_URL]/local/snapshots/carport_2.jpg\",\"url\":\"https://[HA_URL]/local/snapshots/carport_2.jpg\"}}}",
  216.         "dataType": "json",
  217.         "mergecontext": "",
  218.         "output_location": "",
  219.         "output_location_type": "none",
  220.         "mustacheAltTags": false,
  221.         "x": 910,
  222.         "y": 250,
  223.         "wires": [
  224.             []
  225.         ]
  226.     },
  227.     {
  228.         "id": "4c32ca0623407f77",
  229.         "type": "api-call-service",
  230.         "z": "65b4280152d21b71",
  231.         "name": "Snapshot - lastest",
  232.         "server": "3bebce79.1e0962",
  233.         "version": 1,
  234.         "debugenabled": false,
  235.         "service_domain": "camera",
  236.         "service": "snapshot",
  237.         "entityId": "camera.carport_2",
  238.         "data": "{\"filename\":\"/config/www/snapshots/carport_2.jpg\"}",
  239.         "dataType": "json",
  240.         "mergecontext": "",
  241.         "output_location": "",
  242.         "output_location_type": "none",
  243.         "mustacheAltTags": false,
  244.         "x": 640,
  245.         "y": 250,
  246.         "wires": [
  247.             [
  248.                 "470c242a24f346f1"
  249.             ]
  250.         ]
  251.     },
  252.     {
  253.         "id": "47c9eae3ee55c00b",
  254.         "type": "comment",
  255.         "z": "65b4280152d21b71",
  256.         "name": "Set input_boolean when outside temperature is below zero during night",
  257.         "info": "",
  258.         "x": 280,
  259.         "y": 30,
  260.         "wires": []
  261.     },
  262.     {
  263.         "id": "472d20ce71d3919d",
  264.         "type": "comment",
  265.         "z": "65b4280152d21b71",
  266.         "name": "Send actionable notification in the morning - if outside temperature has been below zero during night",
  267.         "info": "",
  268.         "x": 370,
  269.         "y": 130,
  270.         "wires": []
  271.     },
  272.     {
  273.         "id": "2fab09c241c3180a",
  274.         "type": "comment",
  275.         "z": "65b4280152d21b71",
  276.         "name": "Respond to actions",
  277.         "info": "",
  278.         "x": 120,
  279.         "y": 310,
  280.         "wires": []
  281.     },
  282.     {
  283.         "id": "a273fc93b505fdb3",
  284.         "type": "server-events",
  285.         "z": "65b4280152d21b71",
  286.         "name": "IOS Action?",
  287.         "server": "3bebce79.1e0962",
  288.         "event_type": "mobile_app_notification_action",
  289.         "exposeToHomeAssistant": false,
  290.         "haConfig": [
  291.             {
  292.                 "property": "name",
  293.                 "value": ""
  294.             },
  295.             {
  296.                 "property": "icon",
  297.                 "value": ""
  298.             }
  299.         ],
  300.         "waitForRunning": true,
  301.         "x": 100,
  302.         "y": 370,
  303.         "wires": [
  304.             [
  305.                 "5e51010d203fc53b"
  306.             ]
  307.         ]
  308.     },
  309.     {
  310.         "id": "5e51010d203fc53b",
  311.         "type": "switch",
  312.         "z": "65b4280152d21b71",
  313.         "name": "Resonse to alert?",
  314.         "property": "payload.event.action",
  315.         "propertyType": "msg",
  316.         "rules": [
  317.             {
  318.                 "t": "eq",
  319.                 "v": "REMIND_LATER_DEFROST",
  320.                 "vt": "str"
  321.             },
  322.             {
  323.                 "t": "eq",
  324.                 "v": "START_DEFROST",
  325.                 "vt": "str"
  326.             }
  327.         ],
  328.         "checkall": "false",
  329.         "repair": false,
  330.         "outputs": 2,
  331.         "x": 370,
  332.         "y": 370,
  333.         "wires": [
  334.             [
  335.                 "c0c369da35e47c4e"
  336.             ],
  337.             [
  338.                 "fdc4db3e914245f3"
  339.             ]
  340.         ],
  341.         "outputLabels": [
  342.             "Postpone cleaning",
  343.             "Remind me later"
  344.         ]
  345.     },
  346.     {
  347.         "id": "fdc4db3e914245f3",
  348.         "type": "debug",
  349.         "z": "65b4280152d21b71",
  350.         "name": "Start defrost",
  351.         "active": true,
  352.         "tosidebar": true,
  353.         "console": false,
  354.         "tostatus": false,
  355.         "complete": "payload",
  356.         "targetType": "msg",
  357.         "statusVal": "",
  358.         "statusType": "auto",
  359.         "x": 610,
  360.         "y": 400,
  361.         "wires": []
  362.     },
  363.     {
  364.         "id": "c0c369da35e47c4e",
  365.         "type": "delay",
  366.         "z": "65b4280152d21b71",
  367.         "name": "Ask again in 15 mins.",
  368.         "pauseType": "delay",
  369.         "timeout": "15",
  370.         "timeoutUnits": "minutes",
  371.         "rate": "1",
  372.         "nbRateUnits": "1",
  373.         "rateUnits": "second",
  374.         "randomFirst": "1",
  375.         "randomLast": "5",
  376.         "randomUnits": "seconds",
  377.         "drop": false,
  378.         "x": 640,
  379.         "y": 340,
  380.         "wires": [
  381.             [
  382.                 "470c242a24f346f1"
  383.             ]
  384.         ]
  385.     }
  386. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement