Tesla Route never matches home due to capital letter
The problem
When doing Automation and condition to match for Tesla Route: condition:
-
condition: device device_id: ac2308f19695082b51577ebdb4206785 domain: device_tracker entity_id: 8a5ec73b1a6dc440d85e3cb92cabbef1 type: is_home
It will never match, since the value returned from Tesla is Home (with capital H) and the condition will always evaluate to false
What version of Home Assistant Core has the issue?
core-2024.9.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tesla Fleet
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
alias: Tesla coming home
description: ""
trigger:
- platform: zone
entity_id: device_tracker.tesla_y_location
zone: zone.home
event: enter
- type: distance
platform: device
device_id: ac2308f19695082b51577ebdb4206785
entity_id: 79c71be6fd5e8cc589e85f9747d94080
domain: sensor
below: 0.2
condition:
- condition: device
device_id: ac2308f19695082b51577ebdb4206785
domain: device_tracker
entity_id: 8a5ec73b1a6dc440d85e3cb92cabbef1
type: is_home
- type: is_present
condition: device
device_id: ac2308f19695082b51577ebdb4206785
entity_id: f17fa64b9c891db805f1fd0bea3a0873
domain: binary_sensor
- type: is_powered
condition: device
device_id: a4a186ff5bca2a117f4e94a083a598a2
entity_id: 129dab0661b3e236f8d0ca298a41ef8d
domain: binary_sensor
- type: is_speed
condition: device
device_id: ac2308f19695082b51577ebdb4206785
entity_id: 77c7892106cabc53041404d2b9629a81
domain: sensor
below: 30
above: 10
enabled: false
action:
- type: turn_on
device_id: a4a186ff5bca2a117f4e94a083a598a2
entity_id: 280baf5c14c07c3ee9193311d32d629a
domain: switch
mode: single
Anything in the logs that might be useful for us?
Lost the trgiger evaluation, but it clearly showed returned value Home, when condition expected home (notice capital and non-capital h)
Additional information
No response
Sometimes tesla route is detected as "home", sometimes as "Home", see screenshot
Did a workaround to match with OR, between "home" and "Home". Here one execution of the automation: alias: Tesla coming home description: "" trigger:
- platform: zone entity_id: device_tracker.tesla_y_location zone: zone.home event: enter
- type: distance platform: device device_id: ac2308f19695082b51577ebdb4206785 entity_id: 79c71be6fd5e8cc589e85f9747d94080 domain: sensor below: 0.1 condition:
- type: is_present condition: device device_id: ac2308f19695082b51577ebdb4206785 entity_id: f17fa64b9c891db805f1fd0bea3a0873 domain: binary_sensor
- type: is_powered condition: device device_id: a4a186ff5bca2a117f4e94a083a598a2 entity_id: 129dab0661b3e236f8d0ca298a41ef8d domain: binary_sensor
- type: is_speed condition: device device_id: ac2308f19695082b51577ebdb4206785 entity_id: 77c7892106cabc53041404d2b9629a81 domain: sensor below: 30 above: 10 enabled: false
- condition: or
conditions:
- condition: device device_id: ac2308f19695082b51577ebdb4206785 domain: device_tracker entity_id: 8a5ec73b1a6dc440d85e3cb92cabbef1 type: is_home
- condition: state entity_id: device_tracker.tesla_y_route state: Home alias: Test if Tesla Route is to Home(or home) action:
- type: turn_on device_id: a4a186ff5bca2a117f4e94a083a598a2 entity_id: 280baf5c14c07c3ee9193311d32d629a domain: switch
- action: notify.mobile_app_sm_g780g metadata: {} data: message: Opening Garage Gate
- action: light.turn_on metadata: {} data: {} target: device_id: 73132a89d28456c417a61df55dd2f047
- action: onvif.ptz metadata: {} data: distance: 0.1 speed: 0.5 continuous_duration: 0.5 preset: "1" move_mode: GotoPreset target: device_id: 00d02407139f1c3a146fcc1f77e0ca9f
- action: camera.record metadata: {} data: duration: 120 lookback: 10 filename: /media/garage_front_door_{{now().strftime('%Y_%m_%d_%H_%M_%S_%f')}}.mp4 target: device_id: 00d02407139f1c3a146fcc1f77e0ca9f mode: single
Execution on step for the route: Executed: September 19, 2024 at 8:32:34 PM Result:
result: true
conditions/0 Executed: September 19, 2024 at 8:32:34 PM Result:
result: false state: Home wanted_state: home
conditions/1 Executed: September 19, 2024 at 8:32:34 PM Result:
result: true
conditions/1/entity_id/0 Executed: September 19, 2024 at 8:32:34 PM Result:
result: true state: Home wanted_state: Home
Trigered by: type: distance platform: device device_id: ac2308f19695082b51577ebdb4206785 entity_id: 79c71be6fd5e8cc589e85f9747d94080 domain: sensor below: 0.1
unfortunatelly, since I recreated the autoamtion, I do not have a trace to show when the state is reported with lower letter, even though in previous autiomation, I've seen it.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I'm seeing this issue as well with a "wake up" automation that I have configured. Here is the condition state of a successful and a failed automation (notice the state of "Home" versus "home"):
SUCCESS Result: result: true state: home <<< wanted_state: home entity: person.XXX
FAILED Result: result: false state: Home <<< wanted_state: home entity: person.XXX
Similar to this post, it seems to randomly work, but I have no idea as to why.
https://community.home-assistant.io/t/home-vs-home-in-an-automation/325834
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.