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

Web UI incorrectly showing windows as open #329

Closed
Kevga opened this issue Dec 30, 2019 · 7 comments
Closed

Web UI incorrectly showing windows as open #329

Kevga opened this issue Dec 30, 2019 · 7 comments
Labels
kind:bug Something isn't working

Comments

@Kevga
Copy link

Kevga commented Dec 30, 2019

Describe the bug

When I visit the TeslaMate web UI on port 4000, it always shows my windows as open (the icon in the top right). The windows are in fact not open, and the Tesla app shows the "Vent" button under controls, and not the label "Close" that appears when the windows are indeed open.

I manually queried the Tesla API, turns out one of the windows reports the value null while all other windows report the integer 0. Not sure if the sensor is broken or what. Opening and closing all windows didn't change this. In any case, TeslaMate should only show windows as open when at least one window has the value 1 in the API.

To Reproduce

Steps to reproduce the behavior:

  1. Have API return value null for at least one window
  2. Open TeslaMate web page
  3. See the window open icon in the top right

Expected behavior

Ignore error values for the indicator, only show windows as open with a value of 1

Relevant entries from the logs

Nothing relating to windows

Operating environment

  • OS: Raspbian 10 (Buster)
  • TeslaMate Version: 1.14.1
  • Type of installation: Docker
@Kevga Kevga added the kind:bug Something isn't working label Dec 30, 2019
@bahree
Copy link

bahree commented Dec 30, 2019 via email

@Kevga
Copy link
Author

Kevga commented Dec 31, 2019

Oh cool, good to know nothing's wrong with my car. I only started using TeslaMate after installing 2019.40.50.1, so I didn't notice the change in the API. I guess Tesla will fix this soon, but it might still be a good idea to fix the condition that makes the icon appear in TeslaMate.

@adriankumpf adriankumpf removed the kind:bug Something isn't working label Jan 1, 2020
@adriankumpf
Copy link
Collaborator

The windows are in fact not open, and the Tesla app shows the "Vent" button under controls, and not the label "Close" that appears when the windows are indeed open.

It doesn't seem to be the case for you, but in cold weather the windows are often shown as open. In such cases, they are actually slightly open, which the app will show accordingly.

In any case, TeslaMate should only show windows as open when at least one window has the value 1 in the API.

That’s exactly how it works:

https://github.com/adriankumpf/teslamate/blob/18beefbe694c74c1088ff6f87ef7b4c4190b451e/lib/teslamate/vehicles/vehicle/summary.ex#L99-L101

It's gotta be something else that’s causing it? Please let us know if something changes with the next update.

@timguy99
Copy link

timguy99 commented Jan 2, 2020

TeslaMate has always seemed to report this properly when I checked to see what the Tesla app showed. I had this issue with windows being open or Tesla thinking the windows were open or slightly open. A few times I found the windows cracked or the app would allow me to close the windows with the "vent" button (close windows).

If you search online this seems to be a common problem. Also you will see they recommend recalibrating the windows. You can find instructions in the manual. At first it didn't seem to help my situation but I did it a few times and I haven't had issues with the windows since.

@Kevga
Copy link
Author

Kevga commented Jan 5, 2020

When I open all windows, the Tesla API (vehicle_state) shows me the following when I query it manually:

"fd_window": 1,
"fp_window": 1,
"rd_window": 1,
"rp_window": null

When I close all windows, the values are as follows:

"fd_window": 0,
"fp_window": 0,
"rd_window": 0,
"rp_window": null

I only installed TeslaMate ~10 days ago, but it has always showed the icon that my windows are open. Not sure why the API returns null for the rear passenger window and also not sure why this makes the icon appear, the code snippet you linked to looks fine. I never used Elixir though, so I don't know how null values are handled.

@timguy99
Copy link

timguy99 commented Jan 6, 2020

When I open all windows, the Tesla API (vehicle_state) shows me the following when I query it manually:

"fd_window": 1,
"fp_window": 1,
"rd_window": 1,
"rp_window": null

When I close all windows, the values are as follows:

"fd_window": 0,
"fp_window": 0,
"rd_window": 0,
"rp_window": null

I only installed TeslaMate ~10 days ago, but it has always showed the icon that my windows are open. Not sure why the API returns null for the rear passenger window and also not sure why this makes the icon appear, the code snippet you linked to looks fine. I never used Elixir though, so I don't know how null values are handled.

Have you tried recalibrating your right passenger window? Worth a try.

@adriankumpf
Copy link
Collaborator

Turns out there was a typo in the guard clause (see #329 (comment)). So instead of checking whether rp_window was a number fp_window was checked twice!

I didn't know about recalibrating the windows either. Good to know, @timguy99!

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

No branches or pull requests

4 participants