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

Odd data behavior #119

Open
wz2b opened this issue May 4, 2024 · 8 comments
Open

Odd data behavior #119

wz2b opened this issue May 4, 2024 · 8 comments

Comments

@wz2b
Copy link

wz2b commented May 4, 2024

I upgraded from the version of this integration that comes with home assistant to the latest github and there are two things going haywire:

  • The tire pressures are coming in scaled wrong - Home Assistant shows 2757. I think it's 27.57 or just 27.
  • The odometer is coming through as 813 when the actual (including on the mysubaru app) is 505. UPDATE: it's showing kilometers now rather than miles, this is new.

Update: the odometer change is because it's now showing kilometers rather than miles. I'm not where where it got the notion it should do this.

The tire pressure I haven't figured out but "show raw" returns this:

                            'tirePressureFrontLeftPsi': '39.99',
                            'tirePressureFrontRight': None,
                            'tirePressureFrontRightPsi': '39',
                            'tirePressureRearLeft': None,
                            'tirePressureRearLeftPsi': '38',
                            'tirePressureRearRight': None,
                            'tirePressureRearRightPsi': '37',

and "show all" returns this:

                    'TYRE_PRESSURE_FRONT_LEFT': 40.0,
                    'TYRE_PRESSURE_FRONT_RIGHT': 39.0,
                    'TYRE_PRESSURE_REAR_LEFT': 38.0,
                    'TYRE_PRESSURE_REAR_RIGHT': 37.0,

so I think the library is right, and the home assistant end is somehow goofed ...

image

@G-Two
Copy link
Owner

G-Two commented May 6, 2024

Yeah it seems like HA is using all metric values for you (2757 hPa is about 39.9 psi) but displaying imperial unit names. I haven't received any other reports of this issue. Which version of HA are you using? Can you attach your HA generated device diagnostics output here?

@wz2b
Copy link
Author

wz2b commented May 6, 2024 via email

@wz2b
Copy link
Author

wz2b commented May 6, 2024 via email

@G-Two
Copy link
Owner

G-Two commented May 6, 2024

The HA diagnostics output feature would be more helpful for me to trace down the issue since it will show me a single snapshot of the current HA state and the associated JSON dump of the raw mysubaru.com API data (used to create the HA state) in a single file.

image

vehicleStatus is the raw JSON provided by the mysubaru.com API. The 'tyre' vs 'tire' naming is on them. They've changed their field names/casing over the years, so I try to keep things consistently named in vehicle_status (which contains the data after it has been processed by subarulink).

vehicle_status is provided by the subarulink package and what is used by the home assistant integration to set the state for the various sensors. For subarulink>=0.7.10, it should only supply US customary unit values (i.e. HA will convert to metric, if configured). If vehicle_status is supplying metric unit values in your case, then I need to see the raw data to figure out if there is an API inconsistency coming from mysubaru.com

EDIT: Corrected to state subarulink>=0.7.10

@wz2b
Copy link
Author

wz2b commented May 6, 2024

subaru-e8c7878473ca0b27d2edffd38f782e79-Orange-953c6067ab6078a765313226cc0a21fa.json

Got it. Thanks for pointing to the download link. Also thanks for having the foresight to have it automatically scrub identifying information from the file, kudos :)

@G-Two
Copy link
Owner

G-Two commented May 7, 2024

That's strange, it's behaving like an older release of subarulink (metric values for tire pressure, odometer, and fuel economy in vehicle_health). I wonder if something is getting mixed up with python package paths in your container.

Can you enable debug logging for the subaru custom component, and then restart the component and then check your logs. I'd like to see what it is reporting for the first log entry (which should be the version of subarulink actually being run).

Example:

2024-05-06 21:23:41.450 DEBUG (MainThread) [custom_components.subaru] Using subarulink 0.7.11

@wz2b
Copy link
Author

wz2b commented May 7, 2024

Sure.

2024-05-07 08:33:15.586 DEBUG (MainThread) [custom_components.subaru] Using subarulink 0.7.11

Also, inside the container:

ha:/config$ pip list | grep -i subaru
subarulink                       0.7.11

@G-Two
Copy link
Owner

G-Two commented May 7, 2024

I'd like to try to duplicate the issue on my end. Can you point me to a guide (or show me) how you setup your home assistant container with a non-root user? This would also help me with #118

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

2 participants