tronikos / opower

A Python library for getting historical and forecasted usage/cost from utilities that use opower.com such as PG&E
Apache License 2.0
53 stars 49 forks source link

Add Seattle City Light support #57

Closed dewdropawoo closed 7 months ago

dewdropawoo commented 7 months ago

Adds support for Seattle City Light, the power utility for the city of Seattle and some surrounding municipalities.

The auth process is a bit more complicated since Seattle utilities uses the seattle.gov SSO, which uses the Oracle Identity Cloud Service, before being able to access the utility dashboard to request the actual Opower token. My Python's somewhat rusty, happy to fix up anything that might look off.

Some example output from running demo.py:

start_time      end_time        consumption     provided_cost   start_minus_prev_end    end_minus_prev_end
2023-11-26 00:00:00-08:00       2023-11-27 00:00:00-08:00       38.2674 0       None    None
2023-11-27 00:00:00-08:00       2023-11-28 00:00:00-08:00       38.691  0       0:00:00 1 day, 0:00:00
2023-11-28 00:00:00-08:00       2023-11-29 00:00:00-08:00       37.5528 0       0:00:00 1 day, 0:00:00
2023-11-29 00:00:00-08:00       2023-11-30 00:00:00-08:00       41.5926 0       0:00:00 1 day, 0:00:00
2023-11-30 00:00:00-08:00       2023-12-01 00:00:00-08:00       41.502  0       0:00:00 1 day, 0:00:00
2023-12-01 00:00:00-08:00       2023-12-02 00:00:00-08:00       39.4788 0       0:00:00 1 day, 0:00:00
dewdropawoo commented 7 months ago

Fixed, will handle the HA virtual integration PRs, should those be submitted after this PR is merged and the version is bumped? Thanks!

tronikos commented 7 months ago

https://github.com/home-assistant/core/pull/104986 is bumping the version in core. That needs to be merged before you create the virtual integration.