Skip to content

Fixed changes in revenue API endpoint. New url is /revenue/{site_id}.#44

Merged
faanskit merged 2 commits into
faanskit:masterfrom
andreasthell:fix-revenue-api-endpoint
Aug 2, 2025
Merged

Fixed changes in revenue API endpoint. New url is /revenue/{site_id}.#44
faanskit merged 2 commits into
faanskit:masterfrom
andreasthell:fix-revenue-api-endpoint

Conversation

@andreasthell

Copy link
Copy Markdown
Collaborator

Fixes #81 reported in ha-checkwatt

  • Added get_site_id() method to retrieve site id from serial
  • Updated revenue methods
  • Maintained resolution=day parameter for consistency and to now expand too much

Haven't been able to test in HA but example.py works after this change.

- Added get_site_id() method to retrieve site id from serial
- Updated revenue methods
- Maintained resolution=day parameter for consistency and to now expand too much

Fixes #81
@faanskit

Copy link
Copy Markdown
Owner

The github action for Black seems to have failed, would you mind running Black locally and re-submit and I'll merge this untested (cannot test, no longer CheckWatt user/customer)

@andreasthell

Copy link
Copy Markdown
Collaborator Author

Fixed Black formatting issues. Sorry about that - coming from a C# background, I wasn't aware of Black's formatting requirements. Thanks for the guidance!

@faanskit faanskit merged commit 8ddd2b2 into faanskit:master Aug 2, 2025
1 check passed
@faanskit

faanskit commented Aug 2, 2025

Copy link
Copy Markdown
Owner

This is now released in v0.2.9, please try to update ha-checkwatt to use it.
Update the manifest.json and reboot (you may need to re-install it)

  "requirements": ["pycheckwatt>=0.2.8", "aiohttp>=3.9.1"],

to this:

  "requirements": ["pycheckwatt>=0.2.9", "aiohttp>=3.9.1"],

@andreasthell

Copy link
Copy Markdown
Collaborator Author

This is now released in v0.2.9, please try to update ha-checkwatt to use it. Update the manifest.json and reboot (you may need to re-install it)

  "requirements": ["pycheckwatt>=0.2.8", "aiohttp>=3.9.1"],

to this:

  "requirements": ["pycheckwatt>=0.2.9", "aiohttp>=3.9.1"],

Now sure how I would do this, could you give guidance? Just re-installing in hacs did nothing. Can I access the manifest.json without forking ha-checkwatt?

@faanskit

faanskit commented Aug 4, 2025

Copy link
Copy Markdown
Owner

That should be possible. It'll be a hack...
Hacs is basically a tool that updates custom components. So;
Using the file editor in Home Assistant ( Settings, Addons ) you just edit custom_components / ha-checkwatt / manifest,json

You can of course also fork ha-checkwatt and install your variant over the one from hacs.

@andreasthell

Copy link
Copy Markdown
Collaborator Author

Seems to be working. CW has no revenue for me today or tomorrow so I have 0, but no errors in logs and all sensors load ok here.

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

Successfully merging this pull request may close these issues.

2 participants