Giter VIP home page Giter VIP logo

Comments (10)

brianmay avatar brianmay commented on July 22, 2024 2

I think there might be a misunderstanding here. The Tesla API (most likely) does the right thing.

The problem is we are getting nil values from Tesla, which we then interpret as "unknown". We then refuse to publish these to mqtt because - why would we want to publish unknown data? But here nil doesn't mean unknown, it means there is no active route.

At least that is my general feeling. Would be good to have some evidence to back this up. If I am right, the quick fix solution is to add all of those attributes to @always_published as I mentioned above.

If I remember, will try to get the dump of the data from Tesla with and without navigation active. (something I have been wanting to do for a while actually).

from teslamate.

brianmay avatar brianmay commented on July 22, 2024 1

This no doubt is because we don't publish nil values:

https://github.com/teslamate-org/teslamate/blob/master/lib/teslamate/mqtt/pubsub/vehicle_subscriber.ex#L56-L57

This easy solution would be to add this values to the @always_published.

But am uneasy doing this, because publishing a nil values tells mqtt to drop the value from the retain database. Which is probably undesirable for this data. i.e. when you subscribe you would get an instant message if there is an active route, but if there is no route you would not receive a message to say so until the value changes.

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 22, 2024 1

But then when I drove home without navigation

This is expected behavior as no new values got propagated if no new navigation starts.

from teslamate.

brianmay avatar brianmay commented on July 22, 2024 1

The values when the car is not driving and with no route set:

        "drive_state": Object {
            "active_route_latitude": Number(lat2),
            "active_route_longitude": Number(lon2),
            "active_route_traffic_minutes_delay": Number(0.0),
            "gps_as_of": Number(1711399845),
            "heading": Number(200),
            "latitude": Number(lat),
            "longitude": Number(lon),
            "native_latitude": Number(lat),
            "native_location_supported": Number(1),
            "native_longitude": Number(lon),
            "native_type": String("wgs"),
            "power": Number(0),
            "shift_state": Null,
            "speed": Null,
            "timestamp": Number(1711399846493),
        },

I replaced the lat/long values as I don't want to publish the location of my house. But I note that the active route lat/lon is different to the other two values, my guess is that might be the last place we navigated to. Will continue.

from teslamate.

brianmay avatar brianmay commented on July 22, 2024 1

My testing seems to show that the car always provides these attributes, even when not navigating:

  • active_route_latitude
  • active_route_longitude
  • active_route_traffic_minutes_delay

When not navigating, these have values from the last navigation. Wonder if this is a Tesla bug. Doesn't matter though, we have to deal with it. And we have no ability to report this to Tesla either.

This is 2016 Model S upgraded to MCU2.

My suspicion is if I reboot the MCU these values might disappear (not tested).

When navigating, we get additional values. These values only appear when the car is navigating, they don't appear (not even as nil values) when car is not navigating.

  • active_route_destination
  • active_route_energy_at_arrival
  • active_route_miles_to_arrival
  • active_route_minutes_to_arrival

While not strictly related to this issue, the question occurred previously concerning vehicle_state.media_info.a2dp_source_name. It looks like that value is currently set to a Mobile phone even though the car is not connected via bluetooth. So No, you can't use this field to detect if the driver is nearby.

Getting back to this issue, we can't clear the top 3 values, because these values are showing up in the API. But maybe something can be done about the other values.

from teslamate.

vincep5 avatar vincep5 commented on July 22, 2024

@JakobLichterfeld While looking at this from a Home Assistant perspective, I was hoping to use that field active_route_destination to help set off some things at home.. But if that field doesnt get reset to blank or null and the car is not actively navigating anywhere, then the data for it is not useful. The "active" prefix is not accurate then

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 22, 2024

Active navigation is directly propagated from the Tesla API. changing the original behavior within Teslamate would be bad practice as it would change the meaning and would break interoperability and interchangeably.

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 22, 2024

Getting back to this issue, we can't clear the top 3 values, because these values are showing up in the API.

Even if I wish it was not, my assumption about how the Tesla API handles this was correct.

Active navigation is directly propagated from the Tesla API. changing the original behavior within Teslamate would be bad practice as it would change the meaning and would break interoperability and interchangeably.

from teslamate.

vincep5 avatar vincep5 commented on July 22, 2024

from teslamate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.