mypal / ha-dsair

Daikin DS-AIR Custom Component For Home Assistant
MIT License
115 stars 39 forks source link

能否支持金制空气里面电量消耗支持? #28

Open yuhuanfan opened 2 years ago

yuhuanfan commented 2 years ago

能否支持金制空气里面电量消耗支持?例如每天用多少度每月用多少度电kwh?

mypal commented 2 years ago

等着回头研究下,暂未发现有本地协议能返回耗电量。感觉是大金云端计算的理论值,有时间的话看看能不能直接调云端接口获取

xrh0905 commented 2 years ago

抓个包看看?

xrh0905 commented 2 years ago

抓到了 # Result Protocol Host URL Body Caching Content-Type Process Comments Custom 12 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/getUserData 537 application/json;charset=UTF-8 13 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/getQuestionnaireJoinInfo 154 application/json;charset=UTF-8 14 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/getQstnnContact 124 application/json;charset=UTF-8 15 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/getGatewayInfo 244 application/json;charset=UTF-8 16 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/msg/getUnreadCount 65 application/json;charset=UTF-8 19 200 HTTPS newlifemulti.daikin-china.com.cn /v2/mesh/getRaPerformance 29,949 application/json;charset=UTF-8 20 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/weather/getWeatherInfo 201 application/json;charset=UTF-8 23 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/ota/getNewestTerminalVersion 56 application/json;charset=UTF-8 31 200 HTTPS newlifemulti.daikin-china.com.cn /v2/app/getElectricityConsumptionUrl 862 application/json;charset=UTF-8 33 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/MainHome.html?nlcId=<脱敏处理>&macAddress=<脱敏处理>&userType=91&baseUrl=https://newlifemulti.daikin-china.com.cn/app/ 11,251 text/html 34 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/css/MainHome.css 1,726 text/css 39 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/js/jquery.min.js 86,663 application/javascript 40 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/js/echarts.min.js 408,016 application/javascript 41 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/js/VueJS.js 86,457 application/javascript 42 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/js/interactive.js 3,771 application/javascript 43 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/img/nabla.svg 472 image/svg+xml 44 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/img/edit.svg 1,954 image/svg+xml 45 200 HTTPS newlifemulti.daikin-china.com.cn /daikinStaticWeb/newpowerconsumption/css/android.css 262 text/css 46 200 HTTPS newlifemulti.daikin-china.com.cn /app/newPowerConsumption?timestamp=1658408321152 346 application/json;charset=UTF-8

其中

https://newlifemulti.daikin-china.com.cn/daikinStaticWeb/powerconsumptionV2/index.html?nlcId=<脱敏>&macAddress=<脱敏>&userType=91&baseUrl=https://newlifemulti.daikin-china.com.cn/app/ https://newlifemulti.daikin-china.com.cn/daikinStaticWeb/newpowerconsumption/MainHome.html?nlcId=<脱敏>&macAddress=<脱敏>&userType=91&baseUrl=https://newlifemulti.daikin-china.com.cn/app/

@mypal

xrh0905 commented 2 years ago

发现了更底层的API 请求 URL: https://newlifemulti.daikin-china.com.cn/app/newPowerConsumption 请求方法: POST

表单数据 nlcId: <脱敏> macAddress: 33位 不知道怎么来的 year: 2022 month: 7

返回 {"errcode":0,"data":{"year":2022,"month":7,"consumptions":[7.48100,39.45300,39.83200,23.36300,26.83900,20.97800,22.88800,42.88900,27.58600,36.80600,46.40300,28.94800,56.22400,59.82500,55.57800,46.94600,74.99700,43.15000,61.33100,37.76700,0,0,0,0,0,0,0,0,0,0,0],"total":799.284,"price":0.0,"yesterdayUsed":37.767},"errreason":"成功"}

mypal commented 2 years ago

你这把个人标识都泄露了啊,建议删除。看起来接口不复杂,我有空看看怎么加到ha里面

yuhuanfan commented 2 years ago

再问一下能否得到进气口温度?就是现在的室温温度?

xrh0905 commented 2 years ago

再问一下能否得到进气口温度?就是现在的室温温度?

大金新的API貌似不带进气口温度了 读取不了

yuhuanfan commented 2 years ago

这个抓包是不是过几个小时就失效了,我抓了发现用的是阿里云。

xrh0905 commented 2 years ago

金制空气大更新了 旧API不保证能用

mypal commented 1 year ago

金制空气大更新了 旧API不保证能用

我记得之前是北京亚马逊的机房,现在迁到阿里云了么?API安全性也更强了?那感觉API抓取要费劲一些了....