MQTT information regression #437
Replies: 8 comments
-
Great use of TeslaMate and HASS! |
Beta Was this translation helpful? Give feedback.
-
Yeah, it worked REALLY well for me... Until it didn't. :). I think there are two parts here, honestly. It seems like I'm never getting a message on the shift from D to P, because I just need a SINGLE MQTT packet for this to fire. That makes me thing there might be an issue with Streaming transitioning to Polling. The second issue, which I think is still relevant, but not causing my issue, is that Teslamate is publishing empty messages to MQTT when it doesn't have the data - which destroys what information was IN MQTT prior. I guess I'd rather it only publish information to MQTT when it has information to publish, not an empty message because it doesn't have those values. |
Beta Was this translation helpful? Give feedback.
-
I am also impressed with this automation. Pretty cool :) The change to the handling of the shift state was requested in #344. The published value now matches what is being reported by the car through the API, i.e. some firmware versions stop reporting the shift state before the car is ready to sleep. Of course I don't know your automation, but in principle it should be sufficient to change the condition of the automation rule to check whether the switching state is "P" OR empty. |
Beta Was this translation helpful? Give feedback.
-
Given the universal usefulness of an automation like this, maybe we could crowdsource a fix? There's already some doco on integrating HASS and Teslamate, if you were interested in anonymizing your automations a bit @nicholsongreg, we could have a go at making a universal garage opener automation for HASS and TeslaMate? |
Beta Was this translation helpful? Give feedback.
-
I'm hesitant to change to Null, honestly. I understand following the API, which is why I debated two bug reports - #344 is basically the reverse of my second bug. I understand the reasoning of it. I could argue the change but it's a valid change. The first part of the bug is where I'm confused and will have to test more. I'll have to fire up my poller code, but it just doesn't seem right that I'd be sitting in my garage in Park, right after a drive, and the car falls to sleep before it tells the mothership it's in park. My trigger is a simple state change, so any 'P' results should trigger it. I'll see if I can get more information this morning. Regarding the automation - It's actually pretty simple, but I've got no issues putting it up for example code. Do we want a sample/example section in the documentation or just fold it into existing? |
Beta Was this translation helpful? Give feedback.
-
Ok, I apologize. I logged the stream on a short drive this morning, and I am seeing a "P" result from TeslaMate when I expect to see it. Still didn't trigger the automation, when it has in the past, so I've got to look into it further. I've got it conditional on the door being open and the car being home, so perhaps something there is getting into a race condition. But it does look like it's sending the result I needed, so I apologize. Leaving open on the documentation question. |
Beta Was this translation helpful? Give feedback.
-
No worries. Thanks for the update! |
Beta Was this translation helpful? Give feedback.
-
@nicholsongreg you solved the garage door thing in a clever way, this is interesting! Another perspective in case this doesn't pan-out, or you want to augment with other data, this is how I leverage teslamate & home assistant (and node-red I suppose) to auto open and close the garage door: Basically, home-assistant holds the tesla 'distance from home' data via the When the tesla 'distance-from-home' state changes above a certain threshold, it will close the garage door if necessary: ... and when it comes closer to home lower than a certain threshold, it will open the door. |
Beta Was this translation helpful? Give feedback.
-
Prior to version 1.16 Teslamate would publish the shifter state. Typically P,D,N,R. I used this information plus geolocation in HomeAssistant to action my garage door, among other things.
IOW, when the car is HOME and shifts to park, wait 30 seconds and then close the garage door.
Since 1.16, this information is replaced with an empty message after the drive is completed before the action can trigger. During the drive, and immediately before a drive, this information is present. I noticed the problem when the drive completes at my home geo location and the garage door automation fails to trigger.
I CAN get the information to populate by waking the poller, but that defeats the purpose of my automation. Possible bug going from streaming values to polled values? Also possible this is a bug in 2020.4.1 4a4ad401858f, but I believe that the behavior was ok after that update pushed.
To Reproduce
Mqttexplorer logging the teslamate/cars/1/shifter_state topic. Drive somewhere, come back home, get out of car. For me, it transitions from D to empty message without ever hitting park.
Expected behavior
Export P in shifter when car is parked.
Beta Was this translation helpful? Give feedback.
All reactions