Advertisement
Guest User

Untitled

a guest
Feb 18th, 2025
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.79 KB | Source Code | 0 0
  1. [
  2.     {
  3.         "id": "33aa5b84cbda1288",
  4.         "type": "api-current-state",
  5.         "z": "cd7aed7c57ddb35c",
  6.         "name": "",
  7.         "server": "7d73562f276de96f",
  8.         "version": 3,
  9.         "outputs": 1,
  10.         "halt_if": "",
  11.         "halt_if_type": "str",
  12.         "halt_if_compare": "is",
  13.         "entity_id": "calendar.work",
  14.         "state_type": "str",
  15.         "blockInputOverrides": false,
  16.         "outputProperties": [
  17.             {
  18.                 "property": "payload",
  19.                 "propertyType": "msg",
  20.                 "value": "",
  21.                 "valueType": "entityState"
  22.             },
  23.             {
  24.                 "property": "data",
  25.                 "propertyType": "msg",
  26.                 "value": "",
  27.                 "valueType": "entity"
  28.             }
  29.         ],
  30.         "for": "0",
  31.         "forType": "num",
  32.         "forUnits": "minutes",
  33.         "override_topic": false,
  34.         "state_location": "payload",
  35.         "override_payload": "msg",
  36.         "entity_location": "data",
  37.         "override_data": "msg",
  38.         "x": 880,
  39.         "y": 1460,
  40.         "wires": [
  41.             [
  42.                 "d593f55b22b33252"
  43.             ]
  44.         ]
  45.     },
  46.     {
  47.         "id": "d593f55b22b33252",
  48.         "type": "function",
  49.         "z": "cd7aed7c57ddb35c",
  50.         "name": "check if working and @home",
  51.         "func": "// Check if msg.data (the calendar event data) is available and contains the required information.\nif (msg.data && msg.data.attributes && msg.data.attributes.message && msg.data.attributes.location && msg.payload === 'on') {\n  const summary = msg.data.attributes.message;\n  const location = msg.data.attributes.location;\n\n  msg.payload = (summary === 'Work' && location.includes('Home'));\n\n} else {\n  // Handle the case where msg.data or its attributes are missing.  Important for robustness!\n  msg.payload = false; // Or perhaps undefined, depending on how you want to handle it.\n}\n\nreturn msg;",
  52.         "outputs": 1,
  53.         "timeout": 0,
  54.         "noerr": 0,
  55.         "initialize": "",
  56.         "finalize": "",
  57.         "libs": [],
  58.         "x": 1140,
  59.         "y": 1460,
  60.         "wires": [
  61.             []
  62.         ]
  63.     },
  64.     {
  65.         "id": "e5fbbd6d00aacbde",
  66.         "type": "api-call-service",
  67.         "z": "cd7aed7c57ddb35c",
  68.         "name": "perform standing desk script",
  69.         "server": "5",
  70.         "version": 7,
  71.         "debugenabled": false,
  72.         "action": "script.standing_desk",
  73.         "floorId": [],
  74.         "areaId": [],
  75.         "deviceId": [],
  76.         "entityId": [],
  77.         "labelId": [],
  78.         "data": "",
  79.         "dataType": "jsonata",
  80.         "mergeContext": "",
  81.         "mustacheAltTags": false,
  82.         "outputProperties": [],
  83.         "queue": "none",
  84.         "blockInputOverrides": true,
  85.         "domain": "script",
  86.         "service": "standing_desk",
  87.         "x": 1560,
  88.         "y": 1460,
  89.         "wires": [
  90.             []
  91.         ]
  92.     },
  93.     {
  94.         "id": "af6968802093856e",
  95.         "type": "switch",
  96.         "z": "cd7aed7c57ddb35c",
  97.         "name": "true or false?",
  98.         "property": "payload",
  99.         "propertyType": "msg",
  100.         "rules": [
  101.             {
  102.                 "t": "true"
  103.             },
  104.             {
  105.                 "t": "false"
  106.             }
  107.         ],
  108.         "checkall": "true",
  109.         "repair": false,
  110.         "outputs": 2,
  111.         "x": 1350,
  112.         "y": 1460,
  113.         "wires": [
  114.             [
  115.                 "e5fbbd6d00aacbde"
  116.             ],
  117.             []
  118.         ]
  119.     },
  120.     {
  121.         "id": "inject_desk_check",
  122.         "type": "inject",
  123.         "z": "cd7aed7c57ddb35c",
  124.         "name": "Check desk Status",
  125.         "props": [],
  126.         "repeat": "60",
  127.         "crontab": "",
  128.         "once": false,
  129.         "onceDelay": 0.1,
  130.         "topic": "",
  131.         "x": 180,
  132.         "y": 1460,
  133.         "wires": [
  134.             [
  135.                 "trigger_desk_delay"
  136.             ]
  137.         ]
  138.     },
  139.     {
  140.         "id": "b57624e07c316a32",
  141.         "type": "api-current-state",
  142.         "z": "cd7aed7c57ddb35c",
  143.         "name": "desk Off for 40 Minutes",
  144.         "server": "5",
  145.         "version": 3,
  146.         "outputs": 2,
  147.         "halt_if": "",
  148.         "halt_if_type": "str",
  149.         "halt_if_compare": "is",
  150.         "entity_id": "binary_sensor.desk",
  151.         "state_type": "str",
  152.         "blockInputOverrides": true,
  153.         "outputProperties": [
  154.             {
  155.                 "property": "payload",
  156.                 "propertyType": "msg",
  157.                 "value": "",
  158.                 "valueType": "entityState"
  159.             },
  160.             {
  161.                 "property": "data",
  162.                 "propertyType": "msg",
  163.                 "value": "",
  164.                 "valueType": "entity"
  165.             }
  166.         ],
  167.         "for": "40",
  168.         "forType": "num",
  169.         "forUnits": "minutes",
  170.         "override_topic": false,
  171.         "state_location": "payload",
  172.         "override_payload": "msg",
  173.         "entity_location": "data",
  174.         "override_data": "msg",
  175.         "x": 630,
  176.         "y": 1460,
  177.         "wires": [
  178.             [
  179.                 "33aa5b84cbda1288"
  180.             ],
  181.             []
  182.         ]
  183.     },
  184.     {
  185.         "id": "trigger_desk_delay",
  186.         "type": "trigger",
  187.         "z": "cd7aed7c57ddb35c",
  188.         "name": "40 Minute desk Delay",
  189.         "op1": "40",
  190.         "op2": "0",
  191.         "op1type": "num",
  192.         "op2type": "payl",
  193.         "duration": "250",
  194.         "extend": true,
  195.         "overrideDelay": false,
  196.         "units": "min",
  197.         "reset": "off",
  198.         "bytopic": "all",
  199.         "topic": "topic",
  200.         "outputs": 1,
  201.         "x": 400,
  202.         "y": 1460,
  203.         "wires": [
  204.             [
  205.                 "b57624e07c316a32"
  206.             ]
  207.         ]
  208.     },
  209.     {
  210.         "id": "7d73562f276de96f",
  211.         "type": "server",
  212.         "name": "Home Assistant",
  213.         "version": 5,
  214.         "addon": true,
  215.         "rejectUnauthorizedCerts": true,
  216.         "ha_boolean": "y|yes|true|on|home|open",
  217.         "connectionDelay": true,
  218.         "cacheJson": true,
  219.         "heartbeat": false,
  220.         "heartbeatInterval": "30",
  221.         "areaSelector": "friendlyName",
  222.         "deviceSelector": "friendlyName",
  223.         "entitySelector": "friendlyName",
  224.         "statusSeparator": ": ",
  225.         "statusYear": "hidden",
  226.         "statusMonth": "short",
  227.         "statusDay": "numeric",
  228.         "statusHourCycle": "h23",
  229.         "statusTimeFormat": "h:m",
  230.         "enableGlobalContextStore": false
  231.     },
  232.     {
  233.         "id": "5",
  234.         "type": "server",
  235.         "name": "Home Assistant",
  236.         "version": 1,
  237.         "addon": true,
  238.         "rejectUnauthorizedCerts": true,
  239.         "ha_boolean": "y|yes|true|on|home|open",
  240.         "connectionDelay": true,
  241.         "cacheJson": true
  242.     }
  243. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement