mattdavis90 / node-red-contrib-tado-client

Tado web API client node for Node Red
MIT License
23 stars 16 forks source link

add option to read new heating consumption #41

Closed vampywiz17 closed 6 months ago

vampywiz17 commented 2 years ago

Hello there!

It possible to add this new menu to node?

258339054-7178921078788249-6465723985354283561-n

I think this links are help a bit...

https://energy-savings-report.tado.com/en/?homeId=

https://energy-bob.tado.com/

https://energy-savings-report.tado.com/en/7-es2015.b2f640b35ff6b41d2ebf.js

vampywiz17 commented 2 years ago

Finally, a user in HA forum found the link!

curl -H "authorization: Bearer TOKEN" "https://energy-insights.tado.com/api/homes/{homeId}/consumption"

It help to integrate it?

{
  "current": {
    "consumed": {
      "amount": "5.1 kWh",
      "kwh": 5.1,
      "cost": 1.5,
      "m3": 0.5
    },
    "dateRange": {
      "start": "2022-01-01T00:00:00",
      "end": "2022-01-03T23:59:59"
    }
  },
  "last": {
    "consumed": {
      "amount": "156.2 kWh",
      "kwh": 156.2,
      "cost": 43,
      "m3": 14.2
    },
    "dateRange": {
      "start": "2021-12-01T00:00:00",
      "end": "2021-12-31T23:59:59"
    }
  }
}
mattdavis90 commented 2 years ago

Hi, Apologies for the lack of response. I had been looking into this but with other things getting in the way hadn't implemented it yet. The endpoint that I found was https://energy-bob.tado.com/{{home}}/{{year}}-{{month}}

e.g. https://energy-bob.tado.com/12345/2021-12

This yields the following JSON, but it wasn't the same information that you were after. When I get a minute I'll attempt to integrate both endpoints.

{
  "coveredInterval": {
    "start": "2021-10-31T23:42:41.280000Z",
    "end": "2021-11-30T07:13:48.471000Z"
  },
  "totalSavingsAvailable": true,
  "withAutoAssist": {
    "detectedAwayDuration": {
      "value": 178,
      "unit": "HOURS"
    },
    "openWindowDetectionTimes": 9
  },
  "totalSavingsInThermostaticMode": {
    "value": 0,
    "unit": "HOURS"
  },
  "manualControlSaving": {
    "value": 0,
    "unit": "PERCENTAGE"
  },
  "totalSavings": {
    "value": 39.5,
    "unit": "PERCENTAGE"
  },
  "hideSunshineDuration": false,
  "awayDuration": {
    "value": 178,
    "unit": "HOURS"
  },
  "showSavingsInThermostaticMode": false,
  "communityNews": {
    "type": "HOME_AND_AREA_TEMPERATURE_COMPARISON",
    "areaAverageTemperatureInCelsius": 19,
    "homeAverageTemperatureInCelsius": 19.6
  },
  "sunshineDuration": {
    "value": 61,
    "unit": "HOURS"
  },
  "hasAutoAssist": true,
  "openWindowDetectionTimes": 8,
  "setbackScheduleDurationPerDay": {
    "value": 7.599999904632568,
    "unit": "HOURS"
  },
  "totalSavingsInThermostaticModeAvailable": false,
  "yearMonth": "2021-11",
  "hideOpenWindowDetection": false,
  "home": 12345
}
mattdavis90 commented 2 years ago

Also, do you have a link to the HA forum post - I'm wondering if it may help with #42, thanks

vampywiz17 commented 2 years ago

@mattdavis90

here the link

https://community.home-assistant.io/t/read-new-tado-api-features/351521/6

Unfortunately no other info, only just i copy it. But i hope help.