Open KrzysztofHajdamowicz opened 1 year ago
I spend an hour digging through the code and Teslamate MQTT topics.
So far, I understand that Tesla API shows door status with granularity {d,p}{f,r)={true,false}
and Teslamate publishes teslamate/cars/$TESLAMATE_ID/doors_open={true,false}
MQTT message.
That means, that from API you can get status of individual doors, while Teslamate exposes "are any doors open?"
Next, in file binary_sensor.py#L169 there is casting of Tesla API granularity into generic {true/false}
Unfortunately, I have no idea how to merge teslamate.py: MAP_VEHICLE_STATE["doors_open"]
with binary_sensor.py#L169
Probably change it to store the value of the or statement and let teslamate set it true or false. The polling with granularity would then update when it has new info.
Is your feature request related to a problem? Please describe. User wants to automate something car-related, where automation will be triggered by opening and closing car doors. Currently, door status is polled from Tesla servers, instead of using Streaming API/Teslamate+MQTT.
Describe the solution you'd like
sensor.doors
entity updated from Teslamate MQTT.Describe alternatives you've considered Current workaround is using MQTT triggers, but automation gets triggered every dozen of seconds as Teslamate periodically re-sends "doors closed" MQTT message.
Additional context Task is simmilar to #698 , just another entity needs to be synced.