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

Minor logging issue - "Getting appliance usage data" is used twice #43

Open
bcjmk opened this issue Jul 9, 2023 · 2 comments
Open

Minor logging issue - "Getting appliance usage data" is used twice #43

bcjmk opened this issue Jul 9, 2023 · 2 comments

Comments

@bcjmk
Copy link

bcjmk commented Jul 9, 2023

No information on why this ERROR is occurring, but further obscured by wrong detail in the logger. I'm wondering if the "lastBilledDate" is NULL when trying to strftime which is done outside of the try/except section.

async def __getDataFromBalance(self, account) -> dict:
"""get data from appliance usage"""
_LOGGER.info("Getting appliance usage data")

async def __getDataFromApplianceUsage(self, account, lastBilledDate) -> dict:
"""get data from appliance usage"""
_LOGGER.info("Getting appliance usage data")

Version of the custom_component

version 0.0.1

Configuration

Not affected by configuration

Debug log


2023-07-09 12:53:07.077 DEBUG (MainThread) [custom_components.fpl] Getting territory
2023-07-09 12:53:09.561 INFO (MainThread) [custom_components.fpl] Getting Programs
2023-07-09 12:53:09.561 INFO (MainThread) [custom_components.fpl] Getting energy service data
2023-07-09 12:53:14.565 ERROR (MainThread) [custom_components.fpl] 
2023-07-09 12:53:14.571 INFO (MainThread) [custom_components.fpl] Getting appliance usage data
2023-07-09 12:53:19.573 ERROR (MainThread) [custom_components.fpl] 
2023-07-09 12:53:19.577 INFO (MainThread) [custom_components.fpl] Getting appliance usage data
2023-07-09 12:53:19.915 INFO (MainThread) [custom_components.fpl] Logging out
2023-07-09 12:53:20.002 DEBUG (MainThread) [custom_components.fpl] Finished fetching fpl data in 12.925 seconds (success: True)

@bcjmk
Copy link
Author

bcjmk commented Jul 9, 2023

Forgot to mention, this is an intermittent issue. Although it seems to be a pattern. Ran twice successfully, failed both once. Ran once successfully, failed next 2 times. Ran once successfully, failed next 3 times. I'll let it run a few more hours to see if the pattern continues.

@bcjmk
Copy link
Author

bcjmk commented Jul 10, 2023

After running overnight, it looks to be timeout related. When the requests finished in <5 seconds, no errors. 8-10 seconds was a single failure, and >11 seconds was 2 failures. Which makes sense because the timeout is set to 5.
Might need to add the timeout value to the session.post as referred to here for the try/except to catch the error and provide the value.
https://stackoverflow.com/questions/54619868/http-requests-post-timeout

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

1 participant