Apollon77 / daikin-controller-cloud

Connect and Control Daikin Cloud devices
MIT License
96 stars 26 forks source link

Include consumption information for heatpumps #93

Closed FrAcTi0N closed 10 months ago

FrAcTi0N commented 1 year ago

Hourly/daily/weekly consumption information is available.

Apollon77 commented 1 year ago

And how you access the data? By requesting get with the consumption key only?

Apollon77 commented 1 year ago

Can you pleas rtemve the package.json change and package-lock change from the PR? We use a release script which automates the versioning

Apollon77 commented 1 year ago

(alternatively I can also take over the one line myself) ;-)

FrAcTi0N commented 1 year ago

package-lock.json and package.json should be removed from PR. I use one time request for all data with dev.getData() and parse all the stuff i need from that afterwards.

FrAcTi0N commented 1 year ago

or dev.getData('climateControlMainZone', 'consumptionData', '/electrical').heating --> to get 3 arrays (hourly, daily, monthly) with consumption values for heating. "climateControlMainZone" is used by my heatpump instead of "climateControl". Also you can use "cooling" instead of heating to get it for cooling state...

FrAcTi0N commented 1 year ago

and of course, you can take that one line yourself.)

Apollon77 commented 1 year ago

Could youplease be so kind and pos the data returned by dev.getData('climateControlMainZone', 'consumptionData', '/electrical') here? (I do not have such devices personally but want to make sure my assumption is rught about data)

FrAcTi0N commented 1 year ago

sorry, once again. There you are. { heating: { d: [ 2, 2, 3, 2, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 3, 2, 3, 1, 0, 1, 1, null, null, null ], w: [ 16, 15, 17, 25, 18, 22, 26, 20, 15, null, null, null, null, null ], m: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, 0, 0, 230, 455, 158, null ] }, cooling: { d: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null, null, null ], w: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, null, null, null, null, null ], m: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 25, 72, 53, 46, 0, 0, 0, null ] } }

FrAcTi0N commented 1 year ago

well,wait a bit please. I think it needs a bit more to work as expected...

Apollon77 commented 1 year ago

Re your last PR: I also was thinking about how to best detect that special case. maybe go for "/electrical" and "is Object as content" as latest key for now?

FrAcTi0N commented 1 year ago

Updated that one liner so it doesn't change the structure of other properties. It should be ready now. Sorry for confusion.

Apollon77 commented 1 year ago

See my last comment ... maybe even better to include /electical as "special case end node" and do ot check for the actual "sub content"?

FrAcTi0N commented 1 year ago

yep, this one looks like do the trick and doesn't kick the other stuff.) Thanks

ptz0n commented 1 year ago

Would it make sense to put the timestamps at each data point? I guess we can use lastUpdateReceived as reference.

ptz0n commented 1 year ago

Do we have more detailed consumption data available like timestamps? Guessing all data is UTC+0 I would end up with something like this if we look at the daily metrics:

[
  { time: 2023-02-27T00:00:00.000Z, value: 7 }, // yesterday 00:00-02:00
  { time: 2023-02-27T02:00:00.000Z, value: 4 },
  { time: 2023-02-27T04:00:00.000Z, value: 4 },
  { time: 2023-02-27T06:00:00.000Z, value: 5 },
  { time: 2023-02-27T08:00:00.000Z, value: 3 },
  { time: 2023-02-27T10:00:00.000Z, value: 2 },
  { time: 2023-02-27T12:00:00.000Z, value: 2 },
  { time: 2023-02-27T14:00:00.000Z, value: 0 },
  { time: 2023-02-27T16:00:00.000Z, value: 2 },
  { time: 2023-02-27T18:00:00.000Z, value: 10 },
  { time: 2023-02-27T20:00:00.000Z, value: 7 },
  { time: 2023-02-27T22:00:00.000Z, value: 0 },
  { time: 2023-02-28T00:00:00.000Z, value: 10 }, // today 00:00-02:00
  { time: 2023-02-28T02:00:00.000Z, value: 5 },
  { time: 2023-02-28T04:00:00.000Z, value: 4 },
  { time: 2023-02-28T06:00:00.000Z, value: 4 },
  { time: 2023-02-28T08:00:00.000Z, value: 1 },
  { time: 2023-02-28T10:00:00.000Z, value: 0 },
  { time: 2023-02-28T12:00:00.000Z, value: 4 },
  { time: 2023-02-28T14:00:00.000Z, value: 2 },
  { time: 2023-02-28T16:00:00.000Z, value: 3 },
  { time: 2023-02-28T18:00:00.000Z, value: 3 },
  { time: 2023-02-28T20:00:00.000Z, value: 4 },
  { time: 2023-02-28T22:00:00.000Z, value: null }
]
Apollon77 commented 10 months ago

@FrAcTi0N Are you still looking tinto this? me too ... I would need adebug log with the full json data I want to understand what is different

FrAcTi0N commented 10 months ago

@FrAcTi0N Are you still looking tinto this? me too ... I would need adebug log with the full json data I want to understand what is different

I am a bit busy right now. I hope I will find some time in September...

Apollon77 commented 10 months ago

@FrAcTi0N no problem, if you have a full data json log somewhere flying around that I can see the structure add id nd I might find some mins I assume the datapoint is just structured differently

Apollon77 commented 10 months ago

PA: Kind of that line https://github.com/Apollon77/daikin-controller-cloud/blob/main/example/example.js#L75

Apollon77 commented 10 months ago

fixed by 1.2.0