Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the power consumption? #7

Closed
LudovicRousseau opened this issue Aug 6, 2019 · 9 comments
Closed

How to get the power consumption? #7

LudovicRousseau opened this issue Aug 6, 2019 · 9 comments

Comments

@LudovicRousseau
Copy link
Contributor

The iOS applet is able to display an estimation of the energy consumed in kWh.
I could not find this information returned by pcomfortcloud.py.

It could be nice to have this data.
300x0w

@inforsgit
Copy link

I don’t think the AC unit communicates this...looking at the results of a raw dump. How the app gets it I’m not sure.

I agree it would be really nice to have - does anyone have an idea how this is communicated?

@lostfields
Copy link
Owner

lostfields commented Aug 7, 2019

If the app can do it, we may be able to do it. We just need to know the endpoint (url). I may look into this.

the old URL I had ( https://accsmart.panasonic.com/deviceHistoryData ) says "New version app has been published" so I have to figure out the new API.

@lostfields
Copy link
Owner

I actually got the endpoint working, I had to change app-version number in header to X-APP-VERSION: 1.5.1

POST https://accsmart.panasonic.com/deviceHistoryData HTTP/1.1
X-APP-TYPE: 1
X-APP-VERSION: 1.5.1
X-User-Authorization: {{login.response.body.$.uToken}}
User-Agent: G-RAC
Accept: application/json
Content-Type: application/json

{ 
    "dataMode": 0, "date": "20190807", "deviceGuid": "[<deviceGuid here>]", "osTimezone": "+01:00" 
}

dataMode:
0: Day
1: Week
2: Month
3: Year

It will return data like this for week mode

{
	"energyConsumption": 20.270999999999994,
	"estimatedCost": 0.0,
	"deviceRegisterTime": "20181108",
	"currencyUnit": "kr",
	"historyDataList": [{
		"dataNumber": 0,
		"consumption": 2.279999999999999,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.65625,
		"averageOutsideTemp": 16.23958396911621
	}, {
		"dataNumber": 1,
		"consumption": 3.077999999999998,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.42708396911621,
		"averageOutsideTemp": 16.09375
	}, {
		"dataNumber": 2,
		"consumption": 3.397,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.3157901763916,
		"averageOutsideTemp": 15.30526351928711
	}, {
		"dataNumber": 3,
		"consumption": 3.343999999999999,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.536842346191406,
		"averageOutsideTemp": 15.178947448730469
	}, {
		"dataNumber": 4,
		"consumption": 2.7019999999999986,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.51041603088379,
		"averageOutsideTemp": 14.760416984558105
	}, {
		"dataNumber": 5,
		"consumption": 2.568999999999998,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.76041603088379,
		"averageOutsideTemp": 16.0625
	}, {
		"dataNumber": 6,
		"consumption": 2.9009999999999994,
		"cost": 0.0,
		"averageSettingTemp": 20.5,
		"averageInsideTemp": 22.46875,
		"averageOutsideTemp": 15.791666984558105
	}]
}

the only differences is dataNumber, for month it's 0-30, day 0-6 etc.

mine isn't working good though, as mine has stopped reporting data - it only has some data in june for some reason, everything else is empty except the very beginning.

@inforsgit
Copy link

That looks very promising...I really want to try and dump mine in a similar way to see if it's also missing data but I'm afraid I'm too rubbish to work out how to make an HTTP request with all the authentication etc.

Could you maybe create a temporary fork that includes a raw dump of the data, or point me in the right direction of a way to issue the request manually? Thanks...and sorry for my ignorance!!

@lostfields
Copy link
Owner

If you can see the data in the app you are not missing any data.

@inforsgit
Copy link

Ah, ok...I can definitely see all the data in the app :)

@LudovicRousseau
Copy link
Contributor Author

I created a PR for that. No need to change X-APP-VERSION: for me.
#11

@lostfields
Copy link
Owner

solved in PR #11

@simonunzio
Copy link

Hello I would like to get the view of the energy consumption in KW / h on Hassio, I am using the Panasonic Comfort Cloud HA component through HACS and I see that it uses the pcomfortcloud library.
I kindly ask you for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants