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

error: Response missing "obs" data. #14

Closed
garyhooper opened this issue Sep 23, 2023 · 9 comments
Closed

error: Response missing "obs" data. #14

garyhooper opened this issue Sep 23, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@garyhooper
Copy link

Describe The Bug:

After successful initialization, the following error occurs, continuously, approximately every 30 seconds.

[9/23/2023, 3:41:36 PM] [WeatherFlow Tempest Platform] Response missing "obs" data.
[9/23/2023, 3:41:36 PM] [WeatherFlow Tempest Platform] Returning last cached response.

To Reproduce:

Always occurs.

Expected behavior:

No error expected.

Logs:

[9/23/2023, 3:51:25 PM] [WeatherFlow Tempest Platform] Response missing "obs" data.
[9/23/2023, 3:51:25 PM] [WeatherFlow Tempest Platform] Returning last cached response.
[9/23/2023, 3:52:16 PM] [WeatherFlow Tempest Platform] Response missing "obs" data.
[9/23/2023, 3:52:16 PM] [WeatherFlow Tempest Platform] Returning last cached response.

Plugin Config:

{
    "name": "WeatherFlow Tempest Platform",
    "token": "myToken",
    "station_id": myID,
    "interval": 10,
    "units": "Standard",
    "sensors": [
        {
            "name": "Backyard Temperature",
            "sensor_type": "Temperature Sensor",
            "temperature_properties": {
                "value_key": "air_temperature"
            }
        }
    ],
    "_bridge": {
        "username": "myName",
        "port": 30801
    },
    "platform": "WeatherFlowTempest"
}

Screenshots:

Environment:

  • Plugin Version: 3.0.1
  • Homebridge Version: 1.61
  • Node.js Version: 18.13.0
  • NPM Version:
  • Operating System: Docker
@garyhooper garyhooper added the bug Something isn't working label Sep 23, 2023
@DMBlakeley
Copy link
Collaborator

I recently started looking at how to reduce or eliminate the Response missing "obs" data. error as I also felt that the frequency of the error was excessive.

I believe I have made progress and am in test mode. If successful, will submit a PR for @chasenicholl to review.

@chasenicholl
Copy link
Owner

Great thanks everyone.

Additional preview - I’ve been working on a local API socket support version. Hopefully in the next month I’ll get that out the door.

@DMBlakeley
Copy link
Collaborator

The Response missing "obs" data. is due to a ETIMEDOUT response from the Tempest servers.

I have made numerous simplifications to the tempestApi.js code and still cannot make the frequency of this error to go to zero. I have not concluded if this is the Tempest servers or axios compatibility issues. I am pushing a Pull request to your archive for you to review. I have trimmed out a lot of streamlining of the code.

@DMBlakeley
Copy link
Collaborator

DMBlakeley commented Oct 2, 2023

Did some more investigation and found through several sources that the methodology to address axios ETIMEDOUT errors is to set axios.defaults for timeout and add keepAlive: true.

Testing has been very positive, over 18 runtime hours (>6500 samples) received 1 timeout error and 1 Status 502 error (Bad Gateway). This is a significant improvement.

I have made the necessary changes in v3.0.3 and will submit an update to the PR with these changes. Let me know if you want me to combine into a single change.

@DMBlakeley
Copy link
Collaborator

Sqashed into single 3.0.2 PR.

@DMBlakeley
Copy link
Collaborator

DMBlakeley commented Oct 5, 2023

With the changes I submitted I not longer get the Response missing "obs" data error.

But, an interesting observation is that I occasionally get the observation_data is undefined, skipping update error. The interesting part is that the error occurs at 1 second after the hour. Here are the last 5 reported errors:

[10/4/2023, 7:00:01 PM] [WeatherFlow Tempest Platform] observation_data is undefined, skipping update [10/5/2023, 10:00:01 AM] [WeatherFlow Tempest Platform] observation_data is undefined, skipping update [10/5/2023, 6:00:01 PM] [WeatherFlow Tempest Platform] observation_data is undefined, skipping update [10/5/2023, 7:00:01 PM] [WeatherFlow Tempest Platform] observation_data is undefined, skipping update [10/6/2023, 9:00:01 AM] [WeatherFlow Tempest Platform] observation_data is undefined, skipping update

I have gone over the code at least a 100 times trying to figure out why I am even getting this error but the 1 second after the hour timing is even more puzzling.

This of course all goes away if you succeed in implementing a local API.

@chasenicholl
Copy link
Owner

@garyhooper have you tried curling the API to confirm you are using valid Station ID not Device ID?

curl -H "Authorization: Bearer <your_token>" https://swd.weatherflow.com/swd/rest/observations/station/<station_id>

@DMBlakeley
Copy link
Collaborator

DMBlakeley commented Oct 31, 2023

@chasenicholl, I continued to investigate the observation_data is undefined, skipping update error in platform.ts as I could not understand why it was not caught earlier in tempestApi.ts. Refactoring tempestApi.ts I found that the error occurred at initial axios.get from the Tempest server. Still confused why the error occurs at the hour and have placed a service ticket with Tempest asking this question.

v3.0.3 incorporates the additional changes which have been added to the original PR. This version operates quite smoothly but up to you how you want to integrate (or not).

@chasenicholl
Copy link
Owner

Closing stale issue. 3.0.3 released. Thanks @DMBlakeley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants