-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
0.22 vs 0.4x vs Tesla Fleet vs HA 2025.x #78
Comments
It is a very interesting setup you have. I think many people are using this for controlling their solar / car charging. In my setup I also have a home battery, which is useful as it means I don't have to keep changing the car's charging current very often. I attempt to keep the home battery at approx 80%. Once the home battery is close to 80% it sets the car charging current to be the same as the solar production less whatever the house is using. It doesn't have to be very accurate nor update very often as the home battery will either charge a little more, or discharge a little. I don't mind as long as everything I generate ends up in the home battery or the car. I haven't been through all your automation code, but I can comment on some of your questions / comments as follows:
I'm not sure I've answered everthing but hopefully it helps in some way |
Thank you for your suggestions! |
I have implemented various changes in v0.4.3b-dev which is on DockerHub. Main changes are robustness improvements, see the CHANGELOG. I hope this will fix the bluetooth lock up issues see tesla-local-control/tesla_ble_mqtt_core#142 |
Thank you again! Your work is truly awesome. |
It's still dev release so it might still need more work, but I think it's getting there. I haven't tested the feature to set the hci number - if you are able to test this would be great. Set $BLE_HCI_NUM to whatever your setup needs. e.g for most people on hci0 they would set this to 0, etc 'In my case I would use two different hw and Bluetooth for each car. I'll try it.' You should get better performance I think |
No... With integrated bt of my NUC is the same. Presence is ok.
|
Is this your stack.env I assume so? In which case the last line BLE_HCI_NUM=0 set to whatever your hci number is Or you can put it in docker-compose.yml wherever you prefer to set your Docker environment variables |
I've put it in docker-compose.yml |
I'm travelling today so can't really look at it. For the NUC what did you set BLE_HCI_NUM to? Not sure how you tell what the hci number is but it might be worth looking at this in case it's something other than 0 |
Yes. In my case was 0 and I've set 0. Il try with another adapter. |
I'll comment on #82 on that thread. Let me know how you get on with the hci number here! Thanks |
About using 2 different docker with 2 different hardware for send/recive commands for each tesla (pi4 to tesla_mia and nuc with its bt for tesla_c), I've seen that there is some issues with mqtt (mqtt server can't understand the right origin, so send command to all), I've added this line MQTT_TOPIC_PREFIX=tesla_c in stack.env So, I have: MQTT_USERNAME=xxx But It is the same. |
It probably won't work if you have both hardware connected to both cars. Is that what you intended? It should work without any issues if you have the pi4 just set up for car 1 and the nuc just setup for car 2. Can you get this to work? If you must have both devices connected to both cars I will have to give it some thought if possible and if so how to do it. |
One hw, for each tesla! |
OK that should be possible. I will take a look at it and get back to you. Note I have limited time this week so it might be next weekend when I respond |
Haha you are correct, I have setup a second device and can replicate the problem. I will work on a fix |
Please can you send me your version of these logs for each device:
|
I'm trying to add to app/mqtt.sh this line: NUC:
pi4
|
The topic prefix already contains the car VIN. The bug is that the code doesn't check received MQTT messages that the VIN is in VIN_LIST. I can probably do a quick fix. Can you send the same logs for your other car? |
Yes...! I've done... I'me waisting my time for this stupid ``` , because in Italy we don't have it!! |
Ah sorry my fault it came through later whilst I was typing. No idea how you do a on an Italian keyboard! I used to have this in one of my passwords and when using the browser in the Tesla I couldn't find it so I know some keyboards don't have it. I will test a fix soon and send it to you to try |
OK I have a patch for mqtt-listen.sh. The following lines should be inserted into the listen_to_mqtt function:
They go here:
Do you know how to modify the code inside a running container? If so please could you make the mod on both machines, restart the contianers, and test? If not I will make a temporary build when I get chance |
I'm confident it will work so I'll do a new build in Dockerhub |
let me try.... And The other side: |
OK thanks. I will wait for your testing, and if it works I will do a Dockerhub build |
Now i have both Tesla outside, and my dockers restart... And I've added one Bluetooth... So I can test only tomorrow.. |
OK no rush. My daughter has arrived and is staying with me for a few days so I won't have time for much until later in the week. I can do a Dockerhub build if your tests go well |
My two cents... |
The dockers 'listen' to MQTT rather than have messages sent to them. In most use cases there is a single device (maybe supporting multiple cars) so the code is written to listen to messages relating to all cars in the VIN list. Had I envisaged your case of multiple devices I could have subscribed to multiple topics (one topic per VIN) in the mosquitto_sub call. I might rewrite this at some point to do this. As I'm short of time at the moment, the easiest fix was to ignore messages for cars not in the vin list. It won't change the performance just be a more logical. Regarding the BT on your NUC. If the hci is still jumping, I don't think it's going to work. The kernel driver doesn't like whatever tesla-command is doing and is trying to reset the bluetooth device. We can't link to specific UID because this all happens inside Tesla's code (well maybe someone could rewrite it). However I still don't think it will work in your case as the kernel will still object to whatever the code is doing regardless of how we specify the device. I think your options are:
|
I'll try all the suggestions. |
You might find the presence going away on the external BT is fixed after the robustness improvements made in v0.4.3. I can't be sure as it wasn't a problem for me |
In my case I think that the nuc hates my Teslas... |
The bt seems more stronger than previous updates on raspberry Pi2 with bt 5.3, that not hates my Teslas. But with 2 HW, I have this situation: |
Looks like I will have to implement vin specific topics on mosquito_sub. I will do it Weds / thurs when my daughter has gone home |
I'm trying to add some helps, so I've done something like this: |
Yes that's it thanks (at least for a single car per device). Does it fix the problem? |
mmmmhhh not so much... I've "trapped" my mqtt server... |
Ok I'll have to have a closer look when I have time. Won't be until Thursday at the earliest |
Ok I think we have a solution. Because the mosquitto_sub call specifies the client ID, which is the same in both cases, whichever MQTT client reads it first, the MQTT server cleans the message so the other never sees it. That's why it seems to be random which one responds. The fix for this is to remove --disable-clean-session and --id tesla_ble_mqtt from the _sub call I think both clients should read all messages in order to clean up properly. Therefore --topic tesla_ble/right vin/+ should be changed back to --topic tesla_ble/+/+ The line with the call should therefore be changed to this:
The code to ignore messages for cars not in the vin list is still required I've tested it locally with two clients (though I only have one car) and it seems to work. Please could you test it? If it works for you I will add it to #iain-dev and build it for Dockerhub Thanks |
So the new 0.43g has this feature? Or, in any case I must apply this? |
Yes I just built it for DockerHub. It also has vehicle-command v0.3.3 which claims to improve the bluetooth. Might help your NUC? From the CHANGELOG for v0.4.3-g-dev:
|
Perfect! I can use 1 pi4 for first Tesla and 1 pi2 with dongle bt for second Tesla! |
Hello, thank you for your magnificent work, as you might have noticed, I’m a fan of yours! I’ve attached a screenshot to show you how I’m using your Docker, which I’m currently running on version 0.22. I wanted to ask if these observations can also be applied to the newer versions.
I’m using Tesla Fleet at the same time as your tool, where Tesla Fleet is used for querying data, and your tool is used for sending commands. The Docker runs on a Raspberry Pi 4 located near the cars, and the execution time for a command is about 7 seconds. I have solar panels, and my goal is to regulate the charging process based on the sunlight.
As you can see, I’m charging two Tesla cars. The first one is on a three-phase connection (max 11kW), and the other on a single-phase connection (max 3.5kW). I’ve added numbers (in yellow) on the screenshot for reference:
Line 1 corresponds to the kW reserved for my house (I can choose manually), which is calculated as a ratio of solar production and the value read by an automation that adjusts the amperage for the two cars. In this case, I’m reserving 0.5kW for the house, the solar production is 4.63kW, and the Tesla value (number 7 in yellow) tells the automation to use 7A for (number 2 in yellow: “Tesla Mia Amperage”), which is triggered by the automation at point 8.
The other Tesla (number 4) is not using automation, and I’ve manually set it to 3A.
If the Tesla value (number 7) increases or decreases, depending on numbers 9 and 1, the amperage (number 2) also increases or decreases.
Furthermore, if I disable 8 and 5, I can manually adjust the amperage on line 2.
After this long introduction, I’ve noticed that with the newer versions, there seems to be command congestion. Often, when both Teslas are no longer at home, I need to restart the Docker, which doesn’t happen with version 0.22.
Additionally, I’ve noticed that with version 0.22, the value at point 6 in yellow on the screenshot isn’t static but instead updates dynamically. Let me explain better:
When I send the command through your Docker (e.g., 7A), the amperage slider in version 0.22 adjusts to 7. However, in version 0.4x, it needs to be updated manually.
On cloudy days, in addition to creating a constant back-and-forth of commands from the automation (which always needs to know the current charging amperage), this results in the "not-at-home" issue. With Tesla Fleet, I don’t experience this problem, and I could continue using TF along with version 0.22, but I’ve noticed that when upgrading to the new version of HA (2025.x), Tesla Fleet becomes almost unusable.
And so, here’s my final question:
Is it possible to somehow integrate or limit Tesla Fleet (which will likely be discontinued soon) and modify your project to follow a similar approach? I’m also attaching my automation.
Thank you for your support and continuous work.
Automation (3), I've another automation for 4
The text was updated successfully, but these errors were encountered: