teslemetry / hass-teslemetry Goto Github PK
View Code? Open in Web Editor NEWTeslemetry integration from Home Assistant through HACS
Home Page: https://teslemetry.com
License: MIT License
Teslemetry integration from Home Assistant through HACS
Home Page: https://teslemetry.com
License: MIT License
Currently the streaming functionality is implemented and you need OWNER access for this.
I drive a model y via a Lease contract so they are the OWNER and i only have DRIVER access with my account. Please make sure that accounts with only DRIVER access can (partialy) use this integration. After upgrading to v1.7.10 im not able to sign in.
Make sure that accounts with DRIVER access can (partialy) use this integration.
No response
A different TypeError with the stream implementation
Looks like the ignored_variance check for ACChargingEnergyIn is failing.
No response
2024-03-15 20:02:13.992 DEBUG (MainThread) [teslemetry_stream] event {"data": {"ACChargingEnergyIn": "2.242"}, "createdAt": "2024-03-15T10:02:13.974323725Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710496933974}
2024-03-15 20:02:13.992 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/teslemetry_stream/__init__.py", line 193, in listen
listener(event)
File "/config/custom_components/teslemetry/entity.py", line 179, in _handle_stream_update
self._async_value_from_stream(value)
File "/config/custom_components/teslemetry/sensor.py", line 1124, in _async_value_from_stream
self._attr_native_value = self.entity_description.value_fn(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/variance.py", line 44, in wrapper
if last_value is not None and abs(value - last_value) < ignored_variance:
~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'str' and 'float'
Currently Wall Connector integration shows the VIN of the connected vehicle.
Could it also show the vehicle display_name aka Tesla App please?
No response
I have created a subscription to log ModuleTempMax
value in Home Assistant.
unfortunately, it looks that value is returned as string and logged as string by HA, where it should be returned and saved as integer or float value.
This makes it harder or impossible to graph.
N/A
I use some additional vehicle end points in my integrations.
It would be good if these could be added:
charger_phases 2
charge_current_request 2
charge_current_request_max 16
charger_actual_current 0
conn_charge_cable IEC
fast_charger_present false
fast_charger_type ACSingleWireCAN
No response
Some streaming values are coming though, such as SOC:
data: {"data":{"Soc":"81.488","ChargeAmps":"5","ChargeEnableRequest":"true","ChargeLimitSoc":"80","ChargeState":"Idle","ChargeCurrentRequestMax":"16"},"createdAt":"2024-03-15T10:24:54.092491867Z","vin":"5YJ3F7EC5LF698201"}
Whilst others are remaining unknown.
data: {"data":{"EnergyRemaining":"57.120"},"createdAt":"2024-03-15T10:21:23.044564992Z","vin":"5YJ3F7EC5LF698201"}
data: {"data":{"ACChargingPower":"0.000"},"createdAt":"2024-03-15T10:21:53.042763605Z","vin":"5YJ3F7EC5LF698201"}
No response
No response
I use some python scripts to manipulate some more complex data sets:
#!/usr/bin/env python3
try:
import teslapy
except ImportError:
print("Error: The teslapy module is not installed.")
exit()
import teslapy
import datetime
import json
def get_current_tou_period(seasons_data):
current_hour = datetime.datetime.now().hour
current_minute = datetime.datetime.now().minute
current_day_of_week = datetime.datetime.now().weekday()
for season, data in seasons_data.items():
for period, time_ranges in data['tou_periods'].items():
for time_range in time_ranges:
from_hour = time_range['fromHour']
to_hour = time_range['toHour']
from_minute = time_range['fromMinute']
to_minute = time_range['toMinute']
from_day_of_week = time_range['fromDayOfWeek']
to_day_of_week = time_range['toDayOfWeek']
if from_day_of_week <= current_day_of_week <= to_day_of_week:
if from_hour < to_hour:
if (from_hour < current_hour < to_hour) or (from_hour == current_hour and from_minute <= current_minute) or (to_hour == current_hour and current_minute < to_minute):
return period
elif to_hour < from_hour: # This handles the case where the period starts in the evening of one day and ends in the early morning of the next
if (current_hour > from_hour) or (current_hour < to_hour) or (from_hour == current_hour and from_minute <= current_minute) or (to_hour == current_hour and current_minute < to_minute):
return period
return 'Unknown Period'
with teslapy.Tesla("[email protected]") as tesla:
tesla.fetch_token()
battery = tesla.battery_list()[0]
tariff_data = battery.api('SITE_TARIFF')['response']
current_season = 'Summer' # you may need to implement a way to determine the current season dynamically
current_tou_period = get_current_tou_period(tariff_data['seasons'])
buy_cost = tariff_data['energy_charges'][current_season].get(current_tou_period, 'N/A')
sell_price = tariff_data['sell_tariff']['energy_charges'][current_season].get(current_tou_period, 'N/A')
output = {
"tou_period": current_tou_period,
"buy_cost": buy_cost,
"sell_price": sell_price
}
print(json.dumps(output))
#!/usr/bin/env python3
import teslapy
with teslapy.Tesla("[email protected]") as tesla:
tesla.fetch_token()
battery = tesla.battery_list()[0]
# tariff = battery.api('SITE_TARIFF')
# battery.set_backup_reserve_percent(100)
# battery.set_operation(backup)
# print(battery) # should print battery status once successfully authenticated
# print('----')
print(battery.api('SITE_TARIFF'))
import datetime
import teslapy
with teslapy.Tesla('[email protected]') as tesla:
batteries = tesla.battery_list()
battery = batteries[0]
tariff = battery.get_tariff()
# Define tariff periods and costs
default_price = teslapy.BatteryTariffPeriodCost(buy=0.16, sell=0, name='OFF_PEAK')
on_peak = teslapy.BatteryTariffPeriodCost(buy=0.58, sell=0.37, name='ON_PEAK')
partial_peak = teslapy.BatteryTariffPeriodCost(buy=0.28, sell=0.05, name='PARTIAL_PEAK')
off_peak = teslapy.BatteryTariffPeriodCost(buy=0.16, sell=0, name='OFF_PEAK')
super_off_peak = teslapy.BatteryTariffPeriodCost(buy=0.05, sell=0, name='SUPER_OFF_PEAK')
# Define time periods for each tariff
# Example: on_peak_period = teslapy.BatteryTariffPeriod(on_peak, start_time, end_time)
# Note: start_time and end_time should be datetime.time objects defining the start and end of the period
# Example periods (replace with actual times)
on_peak_period = teslapy.BatteryTariffPeriod(on_peak, datetime.time(17, 0), datetime.time(21, 0))
partial_peak_period = teslapy.BatteryTariffPeriod(partial_peak, datetime.time(14, 0), datetime.time(17, 0))
off_peak_period = teslapy.BatteryTariffPeriod(off_peak, datetime.time(7, 0), datetime.time(14, 0))
super_off_peak_period = teslapy.BatteryTariffPeriod(super_off_peak, datetime.time(0, 0), datetime.time(7, 0))
# Create the tariff
periods = [on_peak_period, partial_peak_period, off_peak_period, super_off_peak_period]
new_tariff = teslapy.Battery.create_tariff(default_price, periods, provider='Amber', plan='Custom via API')
# Set the new tariff
# battery.set_tariff(new_tariff)
# Debugging: Print the original and updated tariffs
print("Original Tariff:", tariff)
print("Updated Tariff:", new_tariff)
import teslapy
# Presuming you have already established a session and fetched the tariff as shown in your earlier code
with teslapy.Tesla('[email protected]') as tesla:
batteries = tesla.battery_list()
battery = batteries[0]
tariff = battery.get_tariff()
# Here's your new TOU periods
new_tou_periods = {
"OFF_PEAK": [
{
"fromDayOfWeek": 0,
"toDayOfWeek": 6,
"fromHour": 0, # New start hour
"fromMinute": 0,
"toHour": 7, # New end hour
"toMinute": 0
},
{
"fromDayOfWeek": 0,
"toDayOfWeek": 6,
"fromHour": 22, # Additional time period
"fromMinute": 0,
"toHour": 23,
"toMinute": 59
}
],
"ON_PEAK": [
{
"fromDayOfWeek": 0,
"toDayOfWeek": 6,
"fromHour": 17, # Changed time
"fromMinute": 0,
"toHour": 20, # Changed time
"toMinute": 0
}
],
"PARTIAL_PEAK": [
{
"fromDayOfWeek": 0,
"toDayOfWeek": 6,
"fromHour": 7, # Changed time
"fromMinute": 0,
"toHour": 17, # Changed time
"toMinute": 0
}
]
}
# Update the tariff dictionary with new TOU periods
tariff['seasons']['Summer']['tou_periods'] = new_tou_periods
# Send the updated tariff back to the Tesla API
battery.set_tariff(tariff)
Interested in methods of accessing these via telemetry, maybe switching to the fleet-api library?
No response
Can we get some information on how this polls the car and how it might affect the car sleeping?
In fact, maybe you could add the cars Sleep status too?
I'd like to see my car sleep which it hasn't done for a while using a previous HA integration.
Other HA projects
None
Integration seems to create lots of entities with none in the name for both vehicle and energy products.
I tried to add value_fn
in sensor.py WALL_CONNECTOR_DESCRIPTIONS
, but SensorEntityDescription
does not provide/expect value_fn
fields, so Home Assistant can't initialize with such change.
No response
No response
Can you add support for activating Home Link please?
Home Link activation
None
Nothing
Everytime the integration pulls new data the sensor._time_to_full_charge get the current date time.
Tesla is sending "time_to_full_charge": 0.0. It looks like the availabilty logic is not working.
No response
This may be an issue in the fleet api library. When an error is returned, the response is not JSON but text. The variable "result" then is of type string instead of dict, resulting in exceptions. Probably affects more entities like trunk or maybe all error handling.
With the reproduction steps, the error is "car could not execute command: already closed". Showing an error here is fine as the entity's state is still changing. The issue is that not the above error message is shown to the user, but "[...]string indices must be integers, not 'str'".
2024-02-13 14:01:23.595 DEBUG (MainThread) [tesla_fleet_api] Sending request to api/1/vehicles/VVVVVVVVVVVVVVVVV/command/charge_port_door_open
2024-02-13 14:01:25.695 DEBUG (MainThread) [tesla_fleet_api] Response Status: 200
2024-02-13 14:01:25.695 DEBUG (MainThread) [tesla_fleet_api] Response JSON: {'response': {'result': True, 'reason': ''}}
2024-02-13 14:01:25.696 DEBUG (MainThread) [custom_components.teslemetry] Command result: {'response': {'result': True, 'reason': ''}}
2024-02-13 14:01:26.045 DEBUG (MainThread) [tesla_fleet_api] Sending request to api/1/vehicles/VVVVVVVVVVVVVVVVV/command/charge_port_door_close
2024-02-13 14:01:26.564 DEBUG (MainThread) [tesla_fleet_api] Response Status: 200
2024-02-13 14:01:26.564 DEBUG (MainThread) [tesla_fleet_api] Response Text: {"response":{"result":false,"string":"car could not execute command: already closed"},"error":"","error_description":""}
2024-02-13 14:01:26.565 DEBUG (MainThread) [custom_components.teslemetry] Command result: {"response":{"result":false,"string":"car could not execute command: already closed"},"error":"","error_description":""}
2024-02-13 14:01:26.565 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [CCCCCCCCCCCCCCC] string indices must be integers, not 'str'
Traceback (most recent call last):
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/core.py", line 2279, in async_call
response_data = await coro
^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/core.py", line 2316, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 892, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 962, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/home/hass/.homeassistant/custom_components/teslemetry/cover.py", line 124, in async_close_cover
await self.handle_command(self.api.charge_port_door_close())
File "/home/hass/.homeassistant/custom_components/teslemetry/entity.py", line 138, in handle_command
if not result["response"]["result"]:
~~~~~~^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'
2024-02-13 14:01:30.617 DEBUG (MainThread) [tesla_fleet_api] Sending request to api/1/vehicles/VVVVVVVVVVVVVVVVV/command/charge_port_door_close
2024-02-13 14:01:31.139 DEBUG (MainThread) [tesla_fleet_api] Response Status: 200
2024-02-13 14:01:31.140 DEBUG (MainThread) [tesla_fleet_api] Response JSON: {'response': {'result': True, 'reason': ''}}
2024-02-13 14:01:31.140 DEBUG (MainThread) [custom_components.teslemetry] Command result: {'response': {'result': True, 'reason': ''}}
Edit: realized this was due to an HA restart timed exactly an hour after parking the car, updating to match what actually happened.
I used to have an automation (with Tesla hacs integration that got killed by the new token requirements) - checking at 10pm that the car was plugged in. Today I happened to restart HA, and all of the states go to Unknown, thus breaking my automation until I manually woke up the car.
Can we keep the previous known state if the car doesn't have live data? Or, the other Tesla integration solved it with an option to force the car awake and update data on startup.
No response
The debug log report ClimateEntity issues for Teslemetry to be reported upstream.
No response
2024-02-08 21:04:43.292 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.teslemetry.climate.TeslemetryClimateEntity'>) does not set ClimateEntityFeature.TURN_OFF but implements the turn_off method. Please report it to the author of the 'teslemetry' custom integration
2024-02-08 21:04:43.292 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.teslemetry.climate.TeslemetryClimateEntity'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please report it to the author of the 'teslemetry' custom integration
2024-02-08 21:04:43.293 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.teslemetry.climate.TeslemetryClimateEntity'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'teslemetry' custom integration
2024-02-08 21:04:43.294 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.teslemetry.climate.TeslemetryClimateEntity'>) does not set ClimateEntityFeature.TURN_OFF but implements the turn_off method. Please report it to the author of the 'teslemetry' custom integration
2024-02-08 21:04:43.294 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.teslemetry.climate.TeslemetryClimateEntity'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please report it to the author of the 'teslemetry' custom integration
2024-02-08 21:04:43.295 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.teslemetry.climate.TeslemetryClimateEntity'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'teslemetry' custom integration
2024-02-08 21:04:43.493 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.tesla_custom.climate.TeslaCarClimate'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/alandtse/tesla/issues
2024-02-08 21:04:43.494 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.tesla_custom.climate.TeslaCarClimate'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/alandtse/tesla/issues
It seems trunks are broken in the Python library
...
No response
No response
No response
Not yet seeing the stream entities appear in Home Assistant
Looks like the ChargerPhases > 1 check is failing.
2024-03-15 17:23:55.878 DEBUG (MainThread) [teslemetry_stream] event {"data": {"Soc": "80.732"}, "createdAt": "2024-03-15T07:22:44.429441182Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487364429}
2024-03-15 17:23:55.879 DEBUG (MainThread) [teslemetry_stream] event {"data": {"ChargeCurrentRequest": "16"}, "createdAt": "2024-03-15T07:22:54.429487543Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487374429}
2024-03-15 17:23:55.879 DEBUG (MainThread) [teslemetry_stream] event {"data": {"Soc": "80.913"}, "createdAt": "2024-03-15T07:23:04.429417483Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487384429}
2024-03-15 17:23:55.879 DEBUG (MainThread) [teslemetry_stream] event {"data": {"ChargerPhases": "2", "ChargeAmps": "16", "ChargeLimitSoc": "100"}, "createdAt": "2024-03-15T07:23:24.429636642Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487404429}
2024-03-15 17:23:55.879 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/teslemetry_stream/__init__.py", line 193, in listen
listener(event)
File "/config/custom_components/teslemetry/entity.py", line 179, in _handle_stream_update
self._async_value_from_stream(value)
File "/config/custom_components/teslemetry/binary_sensor.py", line 270, in _async_value_from_stream
self._attr_is_on = self.entity_description.is_on(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/teslemetry/binary_sensor.py", line 64, in <lambda>
is_on=lambda x: x > 1,
^^^^^
TypeError: '>' not supported between instances of 'str' and 'int'
When the integration is switched to Debug mode the logging should be more verbose.
It would be useful to log which endpoints are queried and the results returned, sensitive data (keys) should be redacted.
Enable integration debug mode.
2024-02-08 21:51:47.996 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Vehicle data in 0.312 seconds (success: True)
2024-02-08 21:51:50.936 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Vehicle data in 0.319 seconds (success: True)
2024-02-08 21:51:51.099 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Energy Site Live data in 0.736 seconds (success: True)
2024-02-08 21:51:51.941 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Energy Site Info data in 0.276 seconds (success: True)
2024-02-08 21:52:18.026 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Vehicle data in 0.343 seconds (success: True)
2024-02-08 21:52:20.886 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Vehicle data in 0.268 seconds (success: True)
2024-02-08 21:52:21.690 DEBUG (MainThread) [custom_components.teslemetry] Finished fetching Teslemetry Energy Site Live data in 1.326 seconds (success: True)
When arriving on the destination. The sensor "Time to arrival" is always currentDateTime. What I see with Postman is that the json entity drive_state.active_route_minutes_to_arrival does not exist.
Dived a bit deeper in the issue and I observed that when you cancel navigation. The entries
Using release 1.4.6
No response
The binary_sensor charge_cable shows "on"/connected, when no cable is connected
The API returns "conn_charge_cable": "<invalid>" when no cable is connected and "conn_charge_cable": "IEC" when a cable is connected (most likely it will return "SAE" in other regions)
In binary_sensor.py "<invalid>" is assumed to be on, and everything else is off. This behavior needs to be inverted. Optionally the plug type could be added as an attribute.
(#21 might be related - it would be interesting to see what is returned by the API for this specific car)
No response
No response
Looks like an intermittent issue with the wall_connectors endpoint as I have 14 of these in my error logs:
This error originated from a custom integration.
Logger: custom_components.teslemetry
Source: helpers/update_coordinator.py:313
Integration: Teslemetry
First occurred: 12:08:26 PM (14 occurrences)
Last logged: 7:19:09 PM
Unexpected error fetching Teslemetry Energy Site Live data: string indices must be integers, not 'str'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/teslemetry/coordinator.py", line 95, in _async_update_data
wc["din"]: wc for wc in data["response"].get("wall_connectors", [])
~~~~^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'
...
site_info snippet
"wall_connectors": [
{
"device_id": "a4936580-75de-4833-a032-52f882188749",
"din": "1529455-02-E--PGT22325087207",
"is_active": true
},
{
"device_id": "216ab0d7-84d6-4aac-baa8-9ada56095440",
"din": "1529455-02-E--PGT22325086977",
"is_active": true
}
],
"disallow_charge_from_grid_with_solar_installed": true,
live_status snippet
```json
"island_status": "on_grid",
"storm_mode_active": false,
"timestamp": "2024-02-18T20:16:49+10:00",
"wall_connectors": [
{
"din": "1529455-02-E--PGT22325087207",
"vin": "LRWYHCFS9PC851970",
"wall_connector_state": 5,
"wall_connector_fault_state": 2,
"wall_connector_power": 0
},
{
"din": "1529455-02-E--PGT22325086977",
"vin": "5YJ3F7EC5LF698201",
"wall_connector_state": 5,
"wall_connector_fault_state": 2,
"wall_connector_power": 0
}
]
}
With the tesla_custom integration, I was able to send commands via the API. The main use I had for this was for sending locations to the nav, as if shared from my phone.
This is possible to do via the Fleet API with:
https://developer.tesla.com/docs/fleet-api#navigation_request and
https://developer.tesla.com/docs/fleet-api#navigation_gps_request
endpoints.
Could we get a service to call to send location addresses (navigation_request
) or coordinates (navigation_gps_request
) to our vehicles?
This is not asking for a general api
service, a la https://github.com/alandtse/tesla/blob/23d23d950d23fd1bfabecc4fa421965086c18451/custom_components/tesla_custom/services.py#L78-L117, but a more focused one. However, if a general service would be better, since it appears at least the navigation_request
command must be done via the REST API: https://github.com/teslamotors/vehicle-command/blob/281db4f5fd82110bd269f933db9bbe50c20c2d89/pkg/proxy/command.go#L335-L336, then that could be useful, even if you need to disavow any liability and not include it in the HASS Core integration.
When using the sensor.VEHICLE_time_to_arrival sensor, it is in timestamp format, which I would expect a sensor named _arrival_time
to be instead. I would expect _time_to_arrival
to instead be a timedelta, so I can easily render it as minutes in notifications and such.
This also affects the _time_to_full_charge
sensor.
Expected:
sensor._time_to_arrival: timedelta
sensor._minutes_to_arrival: int
sensor._arrival_time: timestamp
sensor._time_to_full_charge: timedelta
sensor._minutes_to_full_charge: int
sensor._estimated_full_charge_time (can't think of a good name): timestamp
Maybe steal some code from alandtse/tesla
for this, since this is what I'm expecting... :-p
TeslaCarArrivalTime: https://github.com/alandtse/tesla/blob/dev/custom_components/tesla_custom/sensor.py#L565-L615
TeslaCarTimeChargeComplete: https://github.com/alandtse/tesla/blob/dev/custom_components/tesla_custom/sensor.py#L474-L509
time_in_minutes: >-
{{ (as_timestamp(states('sensor.CAR_time_to_arrival')) - now()).total_seconds() // 60 }}
No response
The Speed Limit number entity is not shown in local units or the vehicles unit of speed.
Change to the Home Assistant local units
None
None
I seem to be missing statistics from the EnergyRemaining sensor.
I can see history for this entity:
No response
No response
The energy_added endpoints are not always increasing, maybe change to state class measurement?
Tessie as well.
Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:301
Integration: Sensor (documentation, issues)
First occurred: 12:10:11 PM (10 occurrences)
Last logged: 7:05:10 PM
Entity sensor.my_t_charge_energy_added_2 from integration teslemetry has state class total_increasing, but its state is not strictly increasing. Triggered by state 17.64 (17.66) with last_updated set to 2024-02-18T03:23:08.223825+00:00. Please report it to the author of the 'teslemetry' custom integration
Entity sensor.duka_charge_energy_added from integration tessie has state class total_increasing, but its state is not strictly increasing. Triggered by state 0.38 (0.4) with last_updated set to 2024-02-18T05:04:10.547934+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+tessie%22
Entity sensor.m3p_t_charge_energy_added_2 from integration teslemetry has state class total_increasing, but its state is not strictly increasing. Triggered by state 0.38 (0.4) with last_updated set to 2024-02-18T05:09:14.302412+00:00. Please report it to the author of the 'teslemetry' custom integration
No response
No response
Inability to wake up the vehicle could be handled as a Warning, as it is generally a transient condition.
It is currently handled as a HomeAssistantError.
No response
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 5:22:17 PM (1 occurrences)
Last logged: 5:22:17 PM
[281471908809152] Could not wake up vehicle
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 111, in async_set_value
await entity.async_set_native_value(native_value)
File "/config/custom_components/teslemetry/number.py", line 190, in async_set_native_value
await self.wake_up_if_asleep()
File "/config/custom_components/teslemetry/entity.py", line 218, in wake_up_if_asleep
raise HomeAssistantError("Could not wake up vehicle")
homeassistant.exceptions.HomeAssistantError: Could not wake up vehicle
This line for assining remove_listeners
throws an UnboundLocalError: cannot access local variable 'remove_listeners' where it is not associated with a valueUnboundLocalError: cannot access local variable 'remove_listeners' where it is not associated with a value.
No response
This may be an issue in the fleet api library. When clicking on the fart button, an exception is reported and no sound is played. Variable 'result' is of type text and empty.
The exception in error handling is like in #30.
EU 2023 Model 3.
2024-02-13 14:01:15.438 DEBUG (MainThread) [tesla_fleet_api] Sending request to api/1/vehicles/VVVVVVVVVVVVVVVVV/command/remote_boombox
2024-02-13 14:01:15.439 DEBUG (MainThread) [tesla_fleet_api] Body: {"sound": 0}
2024-02-13 14:01:15.635 DEBUG (MainThread) [tesla_fleet_api] Response Status: 200
2024-02-13 14:01:15.635 DEBUG (MainThread) [tesla_fleet_api] Response Text:
2024-02-13 14:01:15.635 DEBUG (MainThread) [custom_components.teslemetry] Command result:
2024-02-13 14:01:15.636 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [CCCCCCCCCCCCCCC] string indices must be integers, not 'str'
Traceback (most recent call last):
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/core.py", line 2279, in async_call
response_data = await coro
^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/core.py", line 2316, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 892, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 962, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/components/button/__init__.py", line 139, in _async_press_action
await self.async_press()
File "/home/hass/.homeassistant/custom_components/teslemetry/button.py", line 84, in async_press
await self.handle_command(self.entity_description.func(self))
File "/home/hass/.homeassistant/custom_components/teslemetry/entity.py", line 138, in handle_command
if not result["response"]["result"]:
~~~~~~^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'
I am still seeing the energy_added issue, maybe the threshold check isn't large enough?
This is an ongoing issue with the upstream FleetAPI, with multiple reports for other integrations as well:
home-assistant/core#112558
alandtse/tesla#886
Reported upstream:
teslamotors/vehicle-command#224
No response
2024-03-30 12:10:10.776 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.m3p_t_charge_energy_added_2 from integration teslemetry has state class total_increasing, but its state is not strictly increasing. Triggered by state 6.413 (6.434) with last_updated set to 2024-03-30T02:07:02.384138+00:00. Please create a bug report at https://github.com/Teslemetry/hacs-teslemetry/issues
The Highlander doesn't have a middle seat heater.
Figure out if the vehicle has 2 or 3 rear seat heaters and disabled the middle one appropriately.
Disable it manually.
None
Newly added the integration (and greatly appreciate the work you've done!)
The "charge cable" sensor is always showing "disconnected" for my 2019 model 3. Whether it's actually plugged in and not charging, or charging, or unplugged, always shows disconnected.
No response
Powerwall comes up as unknown model in devices section:
It would be useful to grab part_name and maybe connected batteries part names and numbers.
"gateways": [
{
"device_id": "28d43400-3e08-4f2f-99e0-XXX",
"din": "1152100-14-J--XXX",
"serial_number": "XXX",
"part_number": "1152100-14-J",
"part_type": 10,
"part_name": "Tesla Backup Gateway 2",
"is_active": true,
"site_id": "6ceeeb74-7df9-4e37-91d1-18c7fdee2ea3",
"firmware_version": "24.4.0 0fe780c9",
"updated_datetime": "2024-04-01T05:54:09.531Z"
}
],
"batteries": [
{
"device_id": "388484da-b016-42cf-ad8e-be338f9e7882",
"din": "3012170-05-C--YYY",
"serial_number": "YYY",
"part_number": "3012170-05-C",
"part_type": 2,
"part_name": "Powerwall 2",
"nameplate_max_charge_power": 5000,
"nameplate_max_discharge_power": 5000,
"nameplate_energy": 13500
},
{
"device_id": "a556aade-084f-4012-b1b3-23981a07a8b7",
"din": "3012170-10-B--ZZZ",
"serial_number": "ZZZ",
"part_number": "3012170-10-B",
"part_type": 2,
"part_name": "Powerwall 2",
"nameplate_max_charge_power": 5000,
"nameplate_max_discharge_power": 5000,
"nameplate_energy": 13500
},
No response
This may be an issue in the fleet api library. When clicking on open or close windows, an exception is reported and no window moves. Variable 'result' is of type text and empty, like in #31.
EU 2023 Model 3.
2024-02-13 14:01:50.407 DEBUG (MainThread) [tesla_fleet_api] Sending request to api/1/vehicles/VVVVVVVVVVVVVVVVV/command/window_control
2024-02-13 14:01:50.407 DEBUG (MainThread) [tesla_fleet_api] Body: {"command": "close"}
2024-02-13 14:01:50.615 DEBUG (MainThread) [tesla_fleet_api] Response Status: 200
2024-02-13 14:01:50.615 DEBUG (MainThread) [tesla_fleet_api] Response Text:
2024-02-13 14:01:50.615 DEBUG (MainThread) [custom_components.teslemetry] Command result:
2024-02-13 14:01:50.616 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [CCCCCCCCCCCCCCC] string indices must be integers, not 'str'
Traceback (most recent call last):
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/core.py", line 2279, in async_call
response_data = await coro
^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/core.py", line 2316, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 892, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hass/.local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 962, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/home/hass/.homeassistant/custom_components/teslemetry/cover.py", line 83, in async_close_cover
await self.handle_command(self.api.window_control(command=WindowCommand.CLOSE))
File "/home/hass/.homeassistant/custom_components/teslemetry/entity.py", line 138, in handle_command
if not result["response"]["result"]:
~~~~~~^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'
The seat heater select entities don't work.
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.