Advertisement
Guest User

Untitled

a guest
Sep 1st, 2023
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.95 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "27247b38d1a04870",
  4.         "type": "tab",
  5.         "label": "Tado fogyasztás",
  6.         "disabled": false,
  7.         "info": "",
  8.         "env": []
  9.     },
  10.     {
  11.         "id": "8c83dd0e22a9a4df",
  12.         "type": "debug",
  13.         "z": "27247b38d1a04870",
  14.         "name": "",
  15.         "active": true,
  16.         "tosidebar": true,
  17.         "console": false,
  18.         "tostatus": false,
  19.         "complete": "false",
  20.         "statusVal": "",
  21.         "statusType": "auto",
  22.         "x": 1250,
  23.         "y": 100,
  24.         "wires": []
  25.     },
  26.     {
  27.         "id": "b84de426d9b009e6",
  28.         "type": "inject",
  29.         "z": "27247b38d1a04870",
  30.         "name": "",
  31.         "props": [
  32.             {
  33.                 "p": "payload"
  34.             },
  35.             {
  36.                 "p": "topic",
  37.                 "vt": "str"
  38.             }
  39.         ],
  40.         "repeat": "1800",
  41.         "crontab": "",
  42.         "once": false,
  43.         "onceDelay": 0.1,
  44.         "topic": "",
  45.         "payloadType": "date",
  46.         "x": 110,
  47.         "y": 220,
  48.         "wires": [
  49.             [
  50.                 "71868977.626ca8"
  51.             ]
  52.         ]
  53.     },
  54.     {
  55.         "id": "524aa7a0283978f7",
  56.         "type": "http request",
  57.         "z": "27247b38d1a04870",
  58.         "name": "",
  59.         "method": "use",
  60.         "ret": "obj",
  61.         "paytoqs": "ignore",
  62.         "url": "",
  63.         "tls": "",
  64.         "persist": false,
  65.         "proxy": "",
  66.         "authType": "",
  67.         "senderr": false,
  68.         "x": 810,
  69.         "y": 220,
  70.         "wires": [
  71.             [
  72.                 "47a812e0.ece794",
  73.                 "8c83dd0e22a9a4df"
  74.             ]
  75.         ]
  76.     },
  77.     {
  78.         "id": "2622c977b04551dd",
  79.         "type": "function",
  80.         "z": "27247b38d1a04870",
  81.         "name": "",
  82.         "func": "msg.url = \"https://energy-insights.tado.com/api/homes/home_id/consumption?country=hu\"\nmsg.method = \"GET\"\n\nmsg.headers = {\n    Authorization: \"Bearer \"+ msg.payload.access_token\n}\n\nreturn msg;",
  83.         "outputs": 1,
  84.         "noerr": 0,
  85.         "initialize": "",
  86.         "finalize": "",
  87.         "libs": [],
  88.         "x": 640,
  89.         "y": 220,
  90.         "wires": [
  91.             [
  92.                 "524aa7a0283978f7"
  93.             ]
  94.         ]
  95.     },
  96.     {
  97.         "id": "71868977.626ca8",
  98.         "type": "change",
  99.         "z": "27247b38d1a04870",
  100.         "name": "",
  101.         "rules": [
  102.             {
  103.                 "t": "set",
  104.                 "p": "url",
  105.                 "pt": "msg",
  106.                 "to": "https://auth.tado.com/oauth/token",
  107.                 "tot": "str"
  108.             },
  109.             {
  110.                 "t": "set",
  111.                 "p": "payload",
  112.                 "pt": "msg",
  113.                 "to": "{\"client_id\":\"tado-web-app\",\"grant_type\":\"password\",\"scope\":\"home.user\",\"username\":\"email\",\"password\":\"password\",\"client_secret\":\"wZaRN7rpjn3FoNyF5IFuxg9uMzYJcvOoQ8QWiIqS3hfk6gLhVlG57j5YNoZL2Rtc\"}",
  114.                 "tot": "json"
  115.             },
  116.             {
  117.                 "t": "set",
  118.                 "p": "headers",
  119.                 "pt": "msg",
  120.                 "to": "{\"content-type\":\"application/x-www-form-urlencoded\"}",
  121.                 "tot": "json"
  122.             },
  123.             {
  124.                 "t": "set",
  125.                 "p": "method",
  126.                 "pt": "msg",
  127.                 "to": "POST",
  128.                 "tot": "str"
  129.             }
  130.         ],
  131.         "action": "",
  132.         "property": "",
  133.         "from": "",
  134.         "to": "",
  135.         "reg": false,
  136.         "x": 280,
  137.         "y": 220,
  138.         "wires": [
  139.             [
  140.                 "3ffaed957aa187b4"
  141.             ]
  142.         ]
  143.     },
  144.     {
  145.         "id": "3ffaed957aa187b4",
  146.         "type": "http request",
  147.         "z": "27247b38d1a04870",
  148.         "name": "",
  149.         "method": "use",
  150.         "ret": "obj",
  151.         "paytoqs": "ignore",
  152.         "url": "",
  153.         "tls": "",
  154.         "persist": false,
  155.         "proxy": "",
  156.         "authType": "",
  157.         "senderr": false,
  158.         "x": 470,
  159.         "y": 220,
  160.         "wires": [
  161.             [
  162.                 "2622c977b04551dd"
  163.             ]
  164.         ]
  165.     },
  166.     {
  167.         "id": "47a812e0.ece794",
  168.         "type": "change",
  169.         "z": "27247b38d1a04870",
  170.         "name": "",
  171.         "rules": [
  172.             {
  173.                 "t": "set",
  174.                 "p": "payload.details.totalConsumption",
  175.                 "pt": "msg",
  176.                 "to": "$round(payload.details.totalConsumption, 2)",
  177.                 "tot": "jsonata"
  178.             }
  179.         ],
  180.         "action": "",
  181.         "property": "",
  182.         "from": "",
  183.         "to": "",
  184.         "reg": false,
  185.         "x": 980,
  186.         "y": 340,
  187.         "wires": [
  188.             [
  189.                 "cc51885b4a41d0fa"
  190.             ]
  191.         ]
  192.     },
  193.     {
  194.         "id": "cc51885b4a41d0fa",
  195.         "type": "ha-sensor",
  196.         "z": "27247b38d1a04870",
  197.         "name": "",
  198.         "entityConfig": "455f7029c1a8ac59",
  199.         "version": 0,
  200.         "state": "payload.details.totalConsumption",
  201.         "stateType": "msg",
  202.         "attributes": [],
  203.         "inputOverride": "allow",
  204.         "outputProperties": [],
  205.         "x": 1210,
  206.         "y": 220,
  207.         "wires": [
  208.             []
  209.         ]
  210.     },
  211.     {
  212.         "id": "455f7029c1a8ac59",
  213.         "type": "ha-entity-config",
  214.         "server": "2f1dabb5.cf58e4",
  215.         "deviceConfig": "",
  216.         "name": "sensor config for 455f7029c1a8ac59",
  217.         "version": 6,
  218.         "entityType": "sensor",
  219.         "haConfig": [
  220.             {
  221.                 "property": "name",
  222.                 "value": "gas_consuming_tado"
  223.             },
  224.             {
  225.                 "property": "device_class",
  226.                 "value": "gas"
  227.             },
  228.             {
  229.                 "property": "icon",
  230.                 "value": "mdi:fire"
  231.             },
  232.             {
  233.                 "property": "unit_of_measurement",
  234.                 "value": "m³"
  235.             },
  236.             {
  237.                 "property": "state_class",
  238.                 "value": "total_increasing"
  239.             },
  240.             {
  241.                 "property": "last_reset",
  242.                 "value": ""
  243.             }
  244.         ],
  245.         "resend": true
  246.     },
  247.     {
  248.         "id": "2f1dabb5.cf58e4",
  249.         "type": "server",
  250.         "name": "Home Assistant",
  251.         "version": 5,
  252.         "addon": true,
  253.         "rejectUnauthorizedCerts": true,
  254.         "ha_boolean": "y|yes|true|on|home|open",
  255.         "connectionDelay": true,
  256.         "cacheJson": true,
  257.         "heartbeat": false,
  258.         "heartbeatInterval": "30",
  259.         "areaSelector": "friendlyName",
  260.         "deviceSelector": "friendlyName",
  261.         "entitySelector": "friendlyName",
  262.         "statusSeparator": "at: ",
  263.         "statusYear": "hidden",
  264.         "statusMonth": "short",
  265.         "statusDay": "numeric",
  266.         "statusHourCycle": "h23",
  267.         "statusTimeFormat": "h:m",
  268.         "enableGlobalContextStore": true
  269.     }
  270. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement