-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Accept manual input for rate plan ID (workaround for possible bug in API responses) #31
Comments
The API doesn't allow for zip code lookups. I'll look into adding a "Manual" setup to allow input of the plan directly. |
I got it to return results by passing my zip code by itself as the Address parameter, but I'll check again when I get home to make sure it wasn't a cached response based on a prior query or anything weird like that. I was also using version=8 so it might have used different search behavior. Update: I tried with |
Excellent, thank you for checking, I think a City, State/Zip Code should be fine enough. |
* feat: add address/zip code support fixes #31 * add tests to workflow * Update config_flow.py
* feat: add address/zip code support fixes #31 * Update config_flow.py * chore: add release workflow
Give |
The following happens before and after an uninstall, restart homeassistant conatiner, re-install, restart. This is allowing me to search by zip code, but my utility company still isn't showing and I'm unable to find where to manually enter a rateplan ID. I also noticed that when leaving location blank in configuration, it returns a very large number of utilities when it returned only three options before. I'm not sure how to debug to check whether latitude/longitude is still passing when the location box is cleared since I'm new to GitHub, Python, and Home Assistant. I am also getting "Retrying setup: None" again after selecting any rateplan with the following log entries caught in the container's log output:
I tried running through the config again I get "User input malformed" on Step 3 both when accepting the remembered values from last flow and selecting new values. I'm noticing a bunch of weird log entries I haven't noticed before prior to Home Assistant loading custom integrations, so I'll uninstall this integration, recreate the container with a fresh image pull, then run a configuration validation in Home Assistant before I try installing again to make sure something weird in my environment isn't poisoning these results. |
After recreating the homeassistant container and re-installing 0.1.5-b0 omitting location still returns utilities from all over the country and selecting a rateplan still gets stuck with log entries identical to above:
Reconfiguration selecting different values still gives "User input malformed" does not save. The weird log entries I mentioned appearing prior to custom components seem to just be triggered by restarting Home Assistant from its own GUI and are not present when restarting via docker, so it doesn't appear to be related. |
I found the cause for the "User input malformed" - when repeating the flow, the energy meter option blanks out. Re-selecting an option (in my case None) allows me to safe the re-configuration but it still produces the same errors as above. |
Feel free to roll back, I'll take a look at it in the morning. Thank you for testing. |
There we go, give 0.1.5-b1 a go |
It holds the meter setting on re- now but still returns a large, nationwide list when leaving location blank and gets stuck at "Retrying setup: None". I still can't get the API itself to return the correct utility (it only appears at the web search, but I've never gotten it to appear via API response) or enter a rateplan ID manually. I'm at work right now but I can try to pull more log information when I get home. |
This new beta allows the the manual input of the plan ID. It should also fix the setup not firing as well. |
I'm getting "Unknown error occurred" on Step 1 of configuration now, with the following log entry showing up: This error originated from a custom integration.
|
Ok I'm working on this, feel free to revert to a previous version for now. |
Ok latest beta should clear it all up. |
Latest beta let me set my rate plan ID under Not Listed, but leaving location blank is still returning a huge list. I'm not sure how to check if it's still including lat/long by default or if something else is causing the huge list, but the zip code search is working too. |
You can enable debugging on the library, it should output the URL it's using: service: logger.set_level
data:
openeihttp: debug Also if the location box isn't empty entering |
It looks like leaving location blank is leaving it blank in the request instead of the lat/long pair, and entering "" passed literally on new configs but is sending the lat/long pair when used on re-configuring after first-time configuration. Leaving radius and location totally blank on a new config is doing this: Entering "" instead of radius and location on a new config generates "Unknown Error Occurred" in Step1 and appears to be passing the double-quotes as-is:
This also happens on a new config with "" only in the location: Repeating an existing configuration and replacing a previous location entry with "" does pass latitude and longitude in the request URL. |
Thanks for checking totally forgot to test a new config situation. |
ok I think I have it all sorted now in beta 4 |
New configuration flow with blank location and radius is now pulling location-based results again. The only issue I see is that on re-configure it seems to be treating radius as a mandatory field (giving "User input malformed" if radius is blank or "", only allowing reconfigure if a number is entered). Entering "" as the location is behaving as described as well (tested using a California zip code then reconfiguring and it found me in Colorado). |
excellent, I'll double check on radius |
I changed the radius to only take numbers and gave it a range with a default of |
I'm trying to find a balance, the UI will freak out if the value is |
I believe I've found a suitable work around to the config flow limits in the latest beta. |
I think the changes to the text on the config flow make it a lot clearer. For some reason though now on reconfigure, "" is passed literally as the address parameter resulting in no results returned
|
Shoot I thought I had that filtered out, it tested it on my dev instance, I'll take a look. |
All right, it looks properly sorted in b7 now. |
At first I let HACS upgrade me directly to b8 and I could not configure or reconfigure an instance (any input I tried gave me "Unknown error occurred") but then I downgraded to b7 and it works perfectly. After upgrading to b8 again I get "Unknown error occurred" when trying to configure or re-configure. The already-configured instance from b7 does continue to work in b8.
|
Thanks, I'll move that little tweak into the library so this shouldn't happen, all should be well in b9 |
b9 is still not allowing configure or reconfigure with a "Unknown error occurred", with different radii, blank location, "" location, or zip code entere.
|
Ok I'll take a look again. |
All sorted, I verified it in my dev instance of HA as well. |
Looks good! I'm not finding any odd behavior or discrepancies against what the config flow says it'll do. |
* tests: add more tests (#36) * chore: add more tests * spelling * feat: add address/zip code support (#37) * feat: add address/zip code support fixes #31 * add tests to workflow * Update config_flow.py * chore: add release workflow (#38) * feat: add address/zip code support fixes #31 * Update config_flow.py * chore: add release workflow * fix: config flow errors (#39) * fix: config flow errors * remove unused parameters from get_sensors * feat: add manual input for plan (#40) * feat: add manual input for plan * clean up unused imports * adjust tests * update test * fix test * fix: config flow errors related to the betas (#41) * fix: config flow errors related to the betas * Update en.json * clean up test code * last min tweaks * fix: config flow empty strings convert to None (#42) * fix: config flow empty strings convert to None * fix: add default to radius (#43) * fix: properly fix config flow * code tweak * update tests * fix: allow omitted entry for location on setup (#44) Updated config flow instructions * fix: config flow options and clearing location (#46) * fix: config flow options and clearing location * clean up unused import * clean up testing debug code * adjust tests * feat: add mincharge sensor (#47) * feat: add mincharge sensor * adjust tests * fix: remove unneeded code (#48) * fix: remove unneeded code * fix: resolve incorrectly called method * update dependency (#52) * fix: plan not updating on reconfigure (#54) * fix: adjust rate plan check (#55) * refactor: sensor update for 2021.11.x (#56) * refactor: sensor update for 2021.11.x * update get_sensors function * formatting * fix native_value key * fix icons * fix: change to Home Assistant 2021.12.0+ core
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: