It goes in sensor instead of the previous sensors. You then can make template sensors from the attributes of that one rest sensor.
Thanks. Works like a charm. Thanks for sharing.
I’m trying to pull in the TMPS sensor data but can’t get it to work. Any tips?
- name: "Tesla Front Left Tire Pressure"
device_class: safety
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_fl'] default(0) * 14.5038 | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Tesla Front Right Tire Pressure"
device_class: safety
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_fr'] default(0) * 14.5038 | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Tesla Rear Left Tire Pressure"
device_class: safety
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_rl'] default(0) * 14.5038 | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Tesla Rear Right Tire Pressure"
device_class: safety
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_rr'] default(0) * 14.5038 | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
You’ve got some syntax errors (extra parenthesis and a missing pipe). Try using the template editor in developer tools to test things. This is what it should look like.
{{ state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_fl'] | default(0) * 14.5038 | round(0) }}
Thanks again @nhorvath. Additional lines for template.yaml below in case anyone else is pulling tire pressure, odometer and software version.
- name: "Tesla Front Left Tire Pressure"
device_class: pressure
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_fl'] | default(0) * 14.5038) | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Tesla Front Right Tire Pressure"
device_class: pressure
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_fr'] | default(0) * 14.5038) | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Tesla Rear Left Tire Pressure"
device_class: pressure
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_rl'] | default(0) * 14.5038) | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Tesla Rear Right Tire Pressure"
device_class: pressure
state: "{{ (state_attr('sensor.tesla_state', 'vehicle_state')['tpms_pressure_rr'] | default(0) * 14.5038) | round(0) }}"
state_class: measurement
unit_of_measurement: "PSI"
- name: "Odometer"
device_class: distance
state: "{{ state_attr('sensor.tesla_state', 'vehicle_state')['odometer'] | default(0) | round(0) }}"
state_class: measurement
unit_of_measurement: "Miles"
- name: "Software Version"
state: "{{ state_attr('sensor.tesla_state', 'vehicle_state')['car_version'].split(' ')[0] | default(0)}}"
I was exploring the possibility of achieving a tighter integration using the Tessie API within a custom integration when I stumbled upon the work happening in the next release: Tessie - Home Assistant.
It appears that we will be receiving a Tessie integration within the HA core components in 2024.
Yep just installed it.
Nice, making a proper integration was always on my list of things to do but didn’t have time for.
With the impending shutdown of the Owner API I took it on myself to build that replacement before January. I’m glad many people are finding it useful.
I set it up yesterday in my HA. Looks great!
Brett, Nice work on the Tessie integration.
One question though about caching, and I see you recently had a PR included in core…
Are you caching data or not with this integration:
I am seeing a lot of these error messages:
Logger: homeassistant.components.tessie.coordinator
Source: helpers/update_coordinator.py:313
Integration: Tessie (documentation, issues)
First occurred: January 7, 2024 at 8:45:08 AM (31 occurrences)
Last logged: 6:51:13 AM
Error requesting Tessie data: 408, message='Request Timeout', url=URL('https://api.tessie.com/XXXXXXXXXXXXXXX/state?use_cache=false')
Error requesting Tessie data: 408, message='Request Timeout', url=URL('https://api.tessie.com/YYYYYYYYYYYYYYY/state?use_cache=false')
I have two vehicles connected via your integration, one is sleeping like a baby and the other is up all night and day.
Thanks.
Hey Mark, 408 means you vehicle is offline, as in it has zero network connectivity so we dont know know if its awake or asleep. If its polluting your logs, raise an issue and ill supress them.
Disabling cache was important because otherwise the integration would never know when the vehicle was asleep and kept receiving new the same old state data. It does keep all those old states in the coordinator though, so the entities still show values.
If that is normal then perhaps raising as a Warning rather than an Error would be better, I’ll raise an issue for you. Error requesting Tessie data: 408, message='Request Timeout' · Issue #107515 · home-assistant/core · GitHub
Interestingly the car that wasn’t sleeping was in valet mode and seems to be constantly cycling, ever minute with dashcam and other functions:
I turned off valet mode 10 minutes ago and things may have calmed down:
I’ll guess I’ll know if a few hours if the phantom drain is associated with valet.
Tracked down the issue with the help of the Tessie integration I was able to determine the Tesla Custom Integration was polling the vehicle even though the vehicle device was disabled.
Just working my way though the integration, nice work.
Some queries from me:
What does the switch.charge do?
It always seems to be on regardless if the car is plugged in or not and when switched off it quickly switches back on.
some settings I haven’t seen before?
BatteryHeater does this flag when the car is Supercharger preconditioning?
Dashcam always seems to be running even when sentry mode is off or the car is sleeping. What is it measuring?
Power, one limitation of the unofficial API was it only reports as an int (whole kW), another calculated (more accurate) method was to multiply volts by amps by phases (1 for single phase, 2 for three phase) to come up with Watt. Which methods does this integration support?
How does the TripCharging switch work?
Does it detect when the vehicle is charging outside of the home zone or when using a destination charger (non DC fast charger)?
Charge enables and disables charging, basically you can stop and start charging when the vehicle is plugged in.
As for the rest… Your probably best to consult the Tessie developer documentation because I just implemented what was available as best I could. Get Vehicles
I also know some stuff is going to depend if your on legacy or next-gen connectivity because the Fleet API is different from the Owner API.
I couldn’t see the Tessie entities in HA but after a restart of HA, they all showed up so I deleted this post. Thanks
@nhorvath thank you for creating this post and sharing the information. I’ve been using HA for some time, but 99% GUI-based. I have the Tesla Custom Integration, as well as now the Tessie Integration. I am subscribed to Tessie and have a token that works.
For both Tesla Custom (looks like I now have to use the Tessie token) and Tessie, I see that while I can unlock or lock the door, but I want to be able to pop a specific door. Only the sensors are available but individual doors are not available as switches. If I understand your post correctly, it would allow me to create those individual door switches, among other controls. Since the binary sensors are already in the Tessie Integration, do I simply need to follow the “Then create the switches:” section?
In the end, I just want to be able to say to Google Assistant, for example, “Pop driver door” or any other command without fuss.
Thanks again!
I don’t think the Tessie API has a command to open doors. I don’t see it but here’s the docs. Getting Started
I see what you mean.
For both the iOS and Android apps, individual doors can be “unlatched”. In the case of M3 and MY, the function pops the door (as if one pushed the open door button from the inside). For MX, the door cracks open.
On my iPhone, I am able to use Siri through shortcuts to pop individual doors. On Android, Google Assistant integration is a pain (Tessie points to IFTTT) and the individual pop commands are not documented either.
In any case, I rather use HA. I was hoping to have individual doors as switches in HA, which is what I thought your post was about, but obviously we need to know the string.
I’ll send the dev for Tessie a message and see what he says.