brunsy / ha-frankenergy

Homeassistant integration for Frank Energy
MIT License
5 stars 2 forks source link

Natural gas implementation #1

Open mg-nz opened 2 months ago

mg-nz commented 2 months ago

Checklist

Is your feature request related to a problem? Please describe.

There is a slight issue due to the way that the Frank Energy backend handles accounts with multiple services (e.g. electricity and natural gas). These appear as 2 different billing accounts under the one user account, and viewing information within the mobile app requires switching between the two accounts. If the mobile app is closed with the natural gas account selected then this integration fails to retrieve electricity usage.

Describe the solution you'd like

Step 1 would be to be able to fetch natural gas usage (having selected this within the mobile app). Unfortunately this does not appear to be as simple as modifying the API call address from "../electricity/..." to ".../natural-gas/...." (or naturalgas or gas). Viewing the API calls for the browser-based user control panel shows the API address and parameters are quite different between the two types of accounts (and furthermore different from the mobile ones). Step 2 would be for the integration to be able to actively select the correct account (e.g. first choose the electricity account and retrieve electricity usage, then select the natural gas account and retrieve the natural gas usage).

Describe alternatives you've considered

The only alternative I've looked at would be to manually download usage data and upload it to HA, but this is time-consuming and there doesn't seem be to inherent support for adding data in this way in HA.

Additional context

-

brunsy commented 3 weeks ago

Sorry, haven't had time to look into this and I don't have Gas on my account.

I'm happy to add it in, although to do this I'll need the gas endpoints and response structure from someone. Do you have the android app? If so I can run you through the steps to MITM them, otherwise your best bet is to try and figure them out from the web.