Giter VIP home page Giter VIP logo

hass-teslemetry's Introduction

hass-teslemetry's People

Contributors

bre77 avatar dandelionclock avatar dependabot[bot] avatar purcell-lab avatar zzarne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hass-teslemetry's Issues

Charger cable status always showing disconnected

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

Reproduction steps

  1. Set up teslemetry
  2. plug in charge cable
  3. wake/force update data
  4. Other diagnostic sensors like charging amps/volts are updating quickly as I start/stop charging, but the cable always shows disconnected

image

Debug logs

No response

Energy Exports switch is missing

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

image

Reproduction steps

No response

Debug logs

No response

sensor.x_time_to_arrival is timestamp, rather than timedelta

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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

Reproduction steps

  1. Select sensor.CAR_time_to_arrival in developer tools when vehicle has a destination in the nav
  2. View timestamp, rather than minutes
  3. Notification for "I'll be there in X minutes" requires template for X:
    time_in_minutes: >-
      {{ (as_timestamp(states('sensor.CAR_time_to_arrival')) - now()).total_seconds() // 60 }}
    

Debug logs

No response

Teslemetry command failed, An error occurred while processing the request.

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

When triggering an automation i am getting the following error in the logs.

Error while executing automation automation.tesla_smart_charge_charge_on_solar_power2: Teslemetry command failed, An error occurred while processing the request.
Error while executing automation automation.tesla_smart_charge_charge_on_solar_power2: is_charging

Reproduction steps

...

Debug logs

No response

Powerwall off_grid_vehicle_charging_reserve_percent not updated in sensor

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The site_info end point, reports off-grid reserve, in my case currently 20%.
Screenshot 2024-05-31 11 14 25

However this value doesn't seem to come though to the relevant teslemetry sensor:
image

Reproduction steps

  1. Compare site_info endpoint value with sensor

Debug logs

I note the siteinfo enndpoint off_grid_vehicle_charging_reserve_percent doesn't appear in the diagnostics download. 


{
  "home_assistant": {
    "installation_type": "Home Assistant Supervised",
    "version": "2024.5.0b1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.2",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Australia/Brisbane",
    "os_name": "Linux",
    "os_version": "5.14.0-odroid-arm64",
    "supervisor": "2024.04.4",
    "host_os": "Debian GNU/Linux 11 (bullseye)",
    "docker_version": "24.0.5",
    "chassis": "",
    "run_as_root": true
  },
  "custom_components": {
    "huawei_solar": {
      "documentation": "https://github.com/wlcrs/huawei_solar/wiki",
      "version": "1.3.3",
      "requirements": [
        "huawei-solar==2.2.9"
      ]
    },
    "googlewifi": {
      "documentation": "https://github.com/djtimca/hagooglewifi",
      "version": "0.1.34",
      "requirements": [
        "googlewifi==0.0.21"
      ]
    },
    "meross_lan": {
      "documentation": "https://github.com/krahabb/meross_lan",
      "version": "5.0.4",
      "requirements": []
    },
    "tesla_custom": {
      "documentation": "https://github.com/alandtse/tesla/wiki",
      "version": "3.21.0",
      "requirements": [
        "teslajsonpy==3.10.3"
      ]
    },
    "dyson_cloud": {
      "documentation": "https://github.com/shenxn/ha-dyson",
      "version": "0.15.0",
      "requirements": [
        "libdyson==0.8.7"
      ]
    },
    "solaredge_modbus_multi": {
      "documentation": "https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki",
      "version": "2.4.14-pre.3",
      "requirements": [
        "pymodbus>=3.6.6"
      ]
    },
    "garmin_connect": {
      "documentation": "https://github.com/cyberjunky/home-assistant-garmin_connect",
      "version": "0.2.19",
      "requirements": [
        "garminconnect==0.2.12",
        "tzlocal"
      ]
    },
    "solar_optimizer": {
      "documentation": "https://github.com/jmcollin78/solar_optimizer",
      "version": "3.0.0",
      "requirements": []
    },
    "miele": {
      "documentation": "https://github.com/astrandb/miele",
      "version": "2024.3.0",
      "requirements": [
        "flatdict==4.0.1",
        "pymiele==0.1.7"
      ]
    },
    "scheduler": {
      "documentation": "https://github.com/nielsfaber/scheduler-component",
      "version": "v0.0.0",
      "requirements": []
    },
    "climate_template": {
      "documentation": "https://github.com/jcwillox/hass-template-climate",
      "version": "0.6.1",
      "requirements": []
    },
    "dyson_local": {
      "documentation": "https://github.com/libdyson-wg/ha-dyson",
      "version": "1.3.11",
      "requirements": []
    },
    "versatile_thermostat": {
      "documentation": "https://github.com/jmcollin78/versatile_thermostat",
      "version": "6.2.3",
      "requirements": []
    },
    "localtuya": {
      "documentation": "https://github.com/rospogrigio/localtuya/",
      "version": "5.2.1",
      "requirements": []
    },
    "battery_notes": {
      "documentation": "https://andrew-codechimp.github.io/HA-Battery-Notes/",
      "version": "2.2.7",
      "requirements": []
    },
    "smartthinq_sensors": {
      "documentation": "https://github.com/ollo69/ha-smartthinq-sensors",
      "version": "0.39.0",
      "requirements": [
        "pycountry>=23.0.0",
        "xmltodict>=0.13.0",
        "charset_normalizer>=3.2.0"
      ]
    },
    "solcast_solar": {
      "documentation": "https://github.com/oziee/ha-solcast-solar",
      "version": "v4.0.16",
      "requirements": [
        "aiohttp>=3.8.5",
        "datetime>=4.3",
        "isodate>=0.6.1"
      ]
    },
    "tplink_easy_smart": {
      "documentation": "https://github.com/vmakeev/tplink_easy_smart",
      "version": "0.3.0",
      "requirements": [
        "json5==0.9.10"
      ]
    },
    "solarweb": {
      "documentation": "https://github.com/drc38/Fronius_solarweb",
      "version": "0.2.3",
      "requirements": [
        "fronius-solarweb>=0.2.0"
      ]
    },
    "deebot": {
      "documentation": "https://deebot.readthedocs.io/integrations/home-assistant",
      "version": "3.0.0",
      "requirements": [
        "deebot-client==4.0.0",
        "numpy>=1.23.2"
      ]
    },
    "nintendo_parental": {
      "documentation": "https://github.com/pantherale0/ha-nintendoparentalcontrols",
      "version": "2024.4.0",
      "requirements": [
        "pynintendoparental==0.5.0"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "bureau_of_meteorology": {
      "documentation": "https://github.com/bremor/bureau_of_meteorology",
      "version": "1.2.0",
      "requirements": [
        "iso8601"
      ]
    },
    "powercalc": {
      "documentation": "https://github.com/bramstroker/homeassistant-powercalc",
      "version": "v1.12.0-beta.6",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "opennem": {
      "documentation": "https://github.com/bacco007/sensor.opennem",
      "version": "2022.09.1",
      "requirements": []
    },
    "solaredge_modbus": {
      "documentation": "https://github.com/binsentsu/home-assistant-solaredge-modbus",
      "version": "1.11.1",
      "requirements": [
        "pymodbus==3.5.4"
      ]
    },
    "teslemetry": {
      "documentation": "https://www.home-assistant.io/integrations/teslemetry",
      "version": "v1.8.18",
      "requirements": [
        "tesla-fleet-api==0.5.6",
        "teslemetry-stream==0.2.3"
      ]
    },
    "tesla_gateway": {
      "documentation": "https://github.com/carboncoop/tesla-gateway-ha-component",
      "version": "0.1.0",
      "requirements": [
        "teslapy==2.8.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "teslemetry",
    "name": "Teslemetry",
    "codeowners": [
      "@Bre77"
    ],
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/teslemetry",
    "iot_class": "cloud_polling",
    "issue_tracker": "https://github.com/Teslemetry/hacs-teslemetry/issues",
    "loggers": [
      "tesla_fleet_api",
      "teslemetry_stream"
    ],
    "requirements": [
      "tesla-fleet-api==0.5.6",
      "teslemetry-stream==0.2.3"
    ],
    "version": "v1.8.18",
    "is_built_in": false
  },
  "data": {
    "vehicles": [
      {
        "data": {
          "id": "**REDACTED**",
          "user_id": "**REDACTED**",
          "vehicle_id": "**REDACTED**",
          "vin": "**REDACTED**",
          "color": null,
          "access_type": "DRIVER",
          "granular_access_hide_private": false,
          "tokens": "**REDACTED**",
          "state": "online",
          "in_service": false,
          "id_s": "**REDACTED**",
          "calendar_enabled": true,
          "api_version": 75,
          "backseat_token": null,
          "backseat_token_updated_at": null,
          "share_type_s": "ADD_DRIVER_EXTERNAL",
          "ble_autopair_enrolled": false,
          "charge_state_battery_heater_on": false,
          "charge_state_battery_level": 36,
          "charge_state_battery_range": 95.25,
          "charge_state_charge_amps": 16,
          "charge_state_charge_current_request": 16,
          "charge_state_charge_current_request_max": 16,
          "charge_state_charge_enable_request": true,
          "charge_state_charge_energy_added": 1.82,
          "charge_state_charge_limit_soc": 100,
          "charge_state_charge_limit_soc_max": 100,
          "charge_state_charge_limit_soc_min": 50,
          "charge_state_charge_limit_soc_std": 80,
          "charge_state_charge_miles_added_ideal": 8.0,
          "charge_state_charge_miles_added_rated": 8.0,
          "charge_state_charge_port_cold_weather_mode": false,
          "charge_state_charge_port_color": "<invalid>",
          "charge_state_charge_port_door_open": false,
          "charge_state_charge_port_latch": "Engaged",
          "charge_state_charge_rate": 0.0,
          "charge_state_charger_actual_current": 0,
          "charge_state_charger_phases": null,
          "charge_state_charger_pilot_current": 16,
          "charge_state_charger_power": 0,
          "charge_state_charger_voltage": 2,
          "charge_state_charging_state": "Disconnected",
          "charge_state_conn_charge_cable": "<invalid>",
          "charge_state_est_battery_range": 109.14,
          "charge_state_fast_charger_brand": "<invalid>",
          "charge_state_fast_charger_present": false,
          "charge_state_fast_charger_type": "<invalid>",
          "charge_state_ideal_battery_range": 95.25,
          "charge_state_max_range_charge_counter": 7,
          "charge_state_minutes_to_full_charge": 0,
          "charge_state_not_enough_power_to_heat": null,
          "charge_state_off_peak_charging_enabled": false,
          "charge_state_off_peak_charging_times": "all_week",
          "charge_state_off_peak_hours_end_time": 360,
          "charge_state_preconditioning_enabled": false,
          "charge_state_preconditioning_times": "all_week",
          "charge_state_scheduled_charging_mode": "Off",
          "charge_state_scheduled_charging_pending": false,
          "charge_state_scheduled_charging_start_time": null,
          "charge_state_scheduled_charging_start_time_app": 0,
          "charge_state_scheduled_departure_time": 1713308400,
          "charge_state_scheduled_departure_time_minutes": 540,
          "charge_state_supercharger_session_trip_planner": false,
          "charge_state_time_to_full_charge": 0.0,
          "charge_state_timestamp": 1714213923474,
          "charge_state_trip_charging": false,
          "charge_state_usable_battery_level": 36,
          "charge_state_user_charge_enable_request": null,
          "climate_state_allow_cabin_overheat_protection": true,
          "climate_state_auto_seat_climate_left": false,
          "climate_state_auto_seat_climate_right": false,
          "climate_state_auto_steering_wheel_heat": false,
          "climate_state_battery_heater": false,
          "climate_state_battery_heater_no_power": null,
          "climate_state_bioweapon_mode": false,
          "climate_state_cabin_overheat_protection": "On",
          "climate_state_cabin_overheat_protection_actively_cooling": false,
          "climate_state_climate_keeper_mode": "camp",
          "climate_state_cop_activation_temperature": "High",
          "climate_state_defrost_mode": 0,
          "climate_state_driver_temp_setting": 21.0,
          "climate_state_fan_status": 2,
          "climate_state_hvac_auto_request": "On",
          "climate_state_inside_temp": 21.0,
          "climate_state_is_auto_conditioning_on": true,
          "climate_state_is_climate_on": true,
          "climate_state_is_front_defroster_on": false,
          "climate_state_is_preconditioning": false,
          "climate_state_is_rear_defroster_on": false,
          "climate_state_left_temp_direction": -95,
          "climate_state_max_avail_temp": 28.0,
          "climate_state_min_avail_temp": 15.0,
          "climate_state_outside_temp": 27.5,
          "climate_state_passenger_temp_setting": 21.0,
          "climate_state_remote_heater_control_enabled": true,
          "climate_state_right_temp_direction": -95,
          "climate_state_seat_heater_left": 0,
          "climate_state_seat_heater_rear_center": 0,
          "climate_state_seat_heater_rear_left": 0,
          "climate_state_seat_heater_rear_right": 0,
          "climate_state_seat_heater_right": 0,
          "climate_state_side_mirror_heaters": false,
          "climate_state_steering_wheel_heat_level": 0,
          "climate_state_steering_wheel_heater": false,
          "climate_state_supports_fan_only_cabin_overheat_protection": true,
          "climate_state_timestamp": 1714213923474,
          "climate_state_wiper_blade_heater": false,
          "drive_state_active_route_energy_at_arrival": 41,
          "drive_state_active_route_latitude": "**REDACTED**",
          "drive_state_active_route_longitude": "**REDACTED**",
          "drive_state_active_route_traffic_minutes_delay": 0.0,
          "drive_state_gps_as_of": 1714213922,
          "drive_state_heading": 178,
          "drive_state_latitude": "**REDACTED**",
          "drive_state_longitude": "**REDACTED**",
          "drive_state_native_latitude": "**REDACTED**",
          "drive_state_native_location_supported": 1,
          "drive_state_native_longitude": "**REDACTED**",
          "drive_state_native_type": "wgs",
          "drive_state_power": 0,
          "drive_state_shift_state": null,
          "drive_state_speed": null,
          "drive_state_timestamp": 1714213923474,
          "vehicle_config_aux_park_lamps": "None",
          "vehicle_config_badge_version": 1,
          "vehicle_config_can_accept_navigation_requests": true,
          "vehicle_config_can_actuate_trunks": true,
          "vehicle_config_car_special_type": "base",
          "vehicle_config_car_type": "modely",
          "vehicle_config_charge_port_type": "CCS",
          "vehicle_config_cop_user_set_temp_supported": false,
          "vehicle_config_dashcam_clip_save_supported": true,
          "vehicle_config_default_charge_to_max": true,
          "vehicle_config_driver_assist": "TeslaAP3",
          "vehicle_config_ece_restrictions": false,
          "vehicle_config_efficiency_package": "MYSRPlus2021Q3GFSH",
          "vehicle_config_eu_vehicle": true,
          "vehicle_config_exterior_color": "SolidBlack",
          "vehicle_config_exterior_trim": "Black",
          "vehicle_config_exterior_trim_override": "",
          "vehicle_config_has_air_suspension": false,
          "vehicle_config_has_ludicrous_mode": false,
          "vehicle_config_has_seat_cooling": false,
          "vehicle_config_headlamp_type": "Global",
          "vehicle_config_interior_trim_type": "White2",
          "vehicle_config_key_version": 2,
          "vehicle_config_motorized_charge_port": true,
          "vehicle_config_paint_color_override": "5,182,255,0.7,0.04",
          "vehicle_config_performance_package": "Base2022",
          "vehicle_config_plg": true,
          "vehicle_config_pws": true,
          "vehicle_config_rear_drive_unit": "PM216MOSFET",
          "vehicle_config_rear_seat_heaters": 1,
          "vehicle_config_rear_seat_type": 0,
          "vehicle_config_rhd": true,
          "vehicle_config_roof_color": "RoofColorGlass",
          "vehicle_config_seat_type": null,
          "vehicle_config_spoiler_type": "None",
          "vehicle_config_sun_roof_installed": null,
          "vehicle_config_supports_qr_pairing": false,
          "vehicle_config_third_row_seats": "None",
          "vehicle_config_timestamp": 1714213923474,
          "vehicle_config_trim_badging": "50",
          "vehicle_config_use_range_badging": true,
          "vehicle_config_utc_offset": 36000,
          "vehicle_config_webcam_selfie_supported": true,
          "vehicle_config_webcam_supported": true,
          "vehicle_config_wheel_type": "Induction20Black",
          "vehicle_state_api_version": 75,
          "vehicle_state_autopark_state_v2": "unavailable",
          "vehicle_state_calendar_supported": true,
          "vehicle_state_car_version": "2024.8.9 0cac3042b6cd",
          "vehicle_state_center_display_state": 2,
          "vehicle_state_dashcam_clip_save_available": true,
          "vehicle_state_dashcam_state": "Recording",
          "vehicle_state_df": 0,
          "vehicle_state_dr": 0,
          "vehicle_state_fd_window": 1,
          "vehicle_state_feature_bitmask": "fbdffbff,4b87f",
          "vehicle_state_fp_window": 0,
          "vehicle_state_ft": 0,
          "vehicle_state_is_user_present": true,
          "vehicle_state_locked": false,
          "vehicle_state_media_info_a2dp_source_name": "Pixel 8 Pro",
          "vehicle_state_media_info_audio_volume": 2.6667,
          "vehicle_state_media_info_audio_volume_increment": 0.333333,
          "vehicle_state_media_info_audio_volume_max": 10.333333,
          "vehicle_state_media_info_media_playback_status": "Stopped",
          "vehicle_state_media_info_now_playing_album": "",
          "vehicle_state_media_info_now_playing_artist": "",
          "vehicle_state_media_info_now_playing_duration": 0,
          "vehicle_state_media_info_now_playing_elapsed": 0,
          "vehicle_state_media_info_now_playing_source": "Spotify",
          "vehicle_state_media_info_now_playing_station": "",
          "vehicle_state_media_info_now_playing_title": "",
          "vehicle_state_media_state_remote_control_enabled": true,
          "vehicle_state_notifications_supported": true,
          "vehicle_state_odometer": 12552.405178,
          "vehicle_state_parsed_calendar_supported": true,
          "vehicle_state_pf": 0,
          "vehicle_state_pr": 0,
          "vehicle_state_rd_window": 0,
          "vehicle_state_remote_start": false,
          "vehicle_state_remote_start_enabled": true,
          "vehicle_state_remote_start_supported": true,
          "vehicle_state_rp_window": 0,
          "vehicle_state_rt": 0,
          "vehicle_state_santa_mode": 0,
          "vehicle_state_sentry_mode": false,
          "vehicle_state_sentry_mode_available": false,
          "vehicle_state_service_mode": false,
          "vehicle_state_service_mode_plus": false,
          "vehicle_state_software_update_download_perc": 0,
          "vehicle_state_software_update_expected_duration_sec": 2700,
          "vehicle_state_software_update_install_perc": 1,
          "vehicle_state_software_update_status": "",
          "vehicle_state_software_update_version": " ",
          "vehicle_state_speed_limit_mode_active": false,
          "vehicle_state_speed_limit_mode_current_limit_mph": 85.0,
          "vehicle_state_speed_limit_mode_max_limit_mph": 120,
          "vehicle_state_speed_limit_mode_min_limit_mph": 50.0,
          "vehicle_state_speed_limit_mode_pin_code_set": false,
          "vehicle_state_timestamp": 1714213923473,
          "vehicle_state_tpms_hard_warning_fl": false,
          "vehicle_state_tpms_hard_warning_fr": false,
          "vehicle_state_tpms_hard_warning_rl": false,
          "vehicle_state_tpms_hard_warning_rr": false,
          "vehicle_state_tpms_last_seen_pressure_time_fl": 1714200130,
          "vehicle_state_tpms_last_seen_pressure_time_fr": 1714200130,
          "vehicle_state_tpms_last_seen_pressure_time_rl": 1714200130,
          "vehicle_state_tpms_last_seen_pressure_time_rr": 1714200130,
          "vehicle_state_tpms_pressure_fl": 2.875,
          "vehicle_state_tpms_pressure_fr": 2.925,
          "vehicle_state_tpms_pressure_rl": 2.9,
          "vehicle_state_tpms_pressure_rr": 2.9,
          "vehicle_state_tpms_rcp_front_value": 2.9,
          "vehicle_state_tpms_rcp_rear_value": 2.9,
          "vehicle_state_tpms_soft_warning_fl": false,
          "vehicle_state_tpms_soft_warning_fr": false,
          "vehicle_state_tpms_soft_warning_rl": false,
          "vehicle_state_tpms_soft_warning_rr": false,
          "vehicle_state_valet_mode": false,
          "vehicle_state_valet_pin_needed": false,
          "vehicle_state_vehicle_name": "Betty",
          "vehicle_state_vehicle_self_test_progress": 0,
          "vehicle_state_vehicle_self_test_requested": false,
          "vehicle_state_webcam_available": true
        },
        "stream": {
          "config": {
            "hostname": null,
            "fields": null,
            "alerts": null
          },
          "connected": false
        }
      },
      {
        "data": {
          "id": "**REDACTED**",
          "user_id": "**REDACTED**",
          "vehicle_id": "**REDACTED**",
          "vin": "**REDACTED**",
          "color": null,
          "access_type": "OWNER",
          "display_name": "Duka",
          "option_codes": "AD15,AF00,APFB,APH4,AU3P,BC3R,BT37,CDM0,CH06,COAU,DRRH,DV4W,FC3P,FG31,FM3P,GLFR,HL31,HM30,ID3W,IL31,LTPB,MDL3,MR30,PMNG,PC31,REAP,RF3G,RS3H,S3PB,SA3P,SC04,STCP,SU3C,T3M3,TM00,TW00,UT3P,W32D,WR00,ZINV,MI01,PL31,SLR1,ST30,BG32,I38M,OSSB,AUF1,RSF1,ILF1,FGF1,CPF1,HP30,PT00",
          "granular_access_hide_private": false,
          "tokens": "**REDACTED**",
          "state": "offline",
          "in_service": false,
          "id_s": "**REDACTED**",
          "calendar_enabled": true,
          "api_version": 75,
          "backseat_token": null,
          "backseat_token_updated_at": null,
          "ble_autopair_enrolled": false,
          "command_signing": "allowed",
          "release_notes_supported": true
        },
        "stream": {
          "config": {
            "hostname": "au-test.teslemetry.com",
            "fields": {
              "ACChargingEnergyIn": {
                "interval_seconds": 60
              },
              "ACChargingPower": {
                "interval_seconds": 15
              },
              "BMSState": {
                "interval_seconds": 200
              },
              "BatteryLevel": {
                "interval_seconds": 80
              },
              "BrickVoltageMax": {
                "interval_seconds": 200
              },
              "ChargeAmps": {
                "interval_seconds": 200
              },
              "ChargeEnableRequest": {
                "interval_seconds": 200
              },
              "ChargePort": {
                "interval_seconds": 200
              },
              "ChargePortLatch": {
                "interval_seconds": 200
              },
              "ChargeState": {
                "interval_seconds": 200
              },
              "DCDCEnable": {
                "interval_seconds": 200
              },
              "DestinationLocation": {
                "interval_seconds": 200
              },
              "DriveRail": {
                "interval_seconds": 200
              },
              "EnergyRemaining": {
                "interval_seconds": 200
              },
              "Location": {
                "interval_seconds": 200
              },
              "PackCurrent": {
                "interval_seconds": 200
              },
              "PackVoltage": {
                "interval_seconds": 200
              }
            },
            "alerts": [
              "customer"
            ]
          },
          "connected": true
        }
      }
    ],
    "energysites": [
      {
        "live": {
          "solar_power": 0,
          "percentage_charged": 15.571841548072445,
          "backup_capable": true,
          "battery_power": 830,
          "load_power": 830,
          "grid_status": "Active",
          "grid_services_active": false,
          "grid_power": 0,
          "grid_services_power": 0,
          "generator_power": 0,
          "island_status": "on_grid",
          "storm_mode_active": false,
          "timestamp": "2024-04-27T20:32:03+10:00",
          "wall_connectors": {
            "1529455-02-E--PGT22325087207": {
              "din": "1529455-02-E--PGT22325087207",
              "wall_connector_state": 2,
              "wall_connector_fault_state": 2,
              "wall_connector_power": 0
            },
            "1529455-02-E--PGT22325086977": {
              "din": "1529455-02-E--PGT22325086977",
              "vin": "**REDACTED**",
              "wall_connector_state": 4,
              "wall_connector_fault_state": 2,
              "wall_connector_power": 0
            }
          }
        },
        "info": {
          "id": "1152100-14-J--CN321293G4J50D",
          "site_name": "Gateway",
          "backup_reserve_percent": 0,
          "default_real_mode": "autonomous",
          "installation_date": "**REDACTED**",
          "user_settings_go_off_grid_test_banner_enabled": false,
          "user_settings_storm_mode_enabled": true,
          "user_settings_powerwall_onboarding_settings_set": true,
          "user_settings_powerwall_tesla_electric_interested_in": false,
          "user_settings_vpp_tour_enabled": true,
          "user_settings_sync_grid_alert_enabled": true,
          "user_settings_breaker_alert_enabled": false,
          "components_solar": true,
          "components_solar_type": "pv_panel",
          "components_battery": true,
          "components_grid": true,
          "components_backup": true,
          "components_gateway": "teg",
          "components_load_meter": true,
          "components_tou_capable": true,
          "components_storm_mode_capable": true,
          "components_flex_energy_request_capable": false,
          "components_car_charging_data_supported": false,
          "components_off_grid_vehicle_charging_reserve_supported": false,
          "components_vehicle_charging_performance_view_enabled": false,
          "components_vehicle_charging_solar_offset_view_enabled": false,
          "components_battery_solar_offset_view_enabled": true,
          "components_solar_value_enabled": true,
          "components_energy_value_header": "Energy Value",
          "components_energy_value_subheader": "Estimated Value",
          "components_energy_service_self_scheduling_enabled": true,
          "components_show_grid_import_battery_source_cards": true,
          "components_set_islanding_mode_enabled": true,
          "components_wifi_commissioning_enabled": true,
          "components_backup_time_remaining_enabled": true,
          "components_battery_type": "ac_powerwall",
          "components_configurable": true,
          "components_grid_services_enabled": false,
          "components_gateways": [
            {
              "device_id": "28d43400-3e08-4f2f-99e0-aaf55bfb09a2",
              "din": "1152100-14-J--CN321293G4J50D",
              "serial_number": "CN321293G4J50D",
              "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-26T22:14:37.02Z"
            }
          ],
          "components_batteries": [
            {
              "device_id": "388484da-b016-42cf-ad8e-be338f9e7882",
              "din": "3012170-05-C--TG1222020024E9",
              "serial_number": "TG1222020024E9",
              "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--TG122010001DA5",
              "serial_number": "TG122010001DA5",
              "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
            },
            {
              "device_id": "efaa20fd-9b38-41cc-88a4-9e3417ff8c1c",
              "din": "3012170-05-C--TG1222020024C8",
              "serial_number": "TG1222020024C8",
              "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
            }
          ],
          "components_wall_connectors": [
            {
              "device_id": "a4936580-75de-4833-a032-52f882188749",
              "din": "1529455-02-E--PGT22325087207",
              "part_number": "1529455-02-E",
              "part_type": 15,
              "part_name": "Gen 3 Wall Connector",
              "is_active": true
            },
            {
              "device_id": "216ab0d7-84d6-4aac-baa8-9ada56095440",
              "din": "1529455-02-E--PGT22325086977",
              "part_number": "1529455-02-E",
              "part_type": 15,
              "part_name": "Gen 3 Wall Connector",
              "is_active": true
            }
          ],
          "components_customer_preferred_export_rule": "pv_only",
          "components_net_meter_mode": "battery_ok",
          "components_system_alerts_enabled": true,
          "version": "24.4.0 0fe780c9",
          "battery_count": 3,
          "tariff_content_code": "(edited)",
          "tariff_content_name": "Weekenf (edited)",
          "tariff_content_utility": "Amber",
          "tariff_content_daily_charges": [
            {
              "amount": 0,
              "name": "Charge"
            }
          ],
          "tariff_content_demand_charges_ALL_ALL": 0,
          "tariff_content_energy_charges_ALL_ALL": 0,
          "tariff_content_energy_charges_Summer_OFF_PEAK": 0.15,
          "tariff_content_energy_charges_Summer_ON_PEAK": 0.5,
          "tariff_content_energy_charges_Summer_PARTIAL_PEAK": 0.38,
          "tariff_content_energy_charges_Summer_SUPER_OFF_PEAK": 0.04,
          "tariff_content_seasons_Summer_fromDay": 1,
          "tariff_content_seasons_Summer_toDay": 31,
          "tariff_content_seasons_Summer_fromMonth": 1,
          "tariff_content_seasons_Summer_toMonth": 12,
          "tariff_content_seasons_Summer_tou_periods_OFF_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 0,
              "fromMinute": 0,
              "toHour": 9,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 14,
              "fromMinute": 0,
              "toHour": 16,
              "toMinute": 0
            }
          ],
          "tariff_content_seasons_Summer_tou_periods_ON_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 17,
              "fromMinute": 0,
              "toHour": 19,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 22,
              "fromMinute": 0,
              "toHour": 22,
              "toMinute": 30
            }
          ],
          "tariff_content_seasons_Summer_tou_periods_PARTIAL_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 16,
              "fromMinute": 0,
              "toHour": 17,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 19,
              "fromMinute": 0,
              "toHour": 22,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 22,
              "fromMinute": 30,
              "toHour": 0,
              "toMinute": 0
            }
          ],
          "tariff_content_seasons_Summer_tou_periods_SUPER_OFF_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 9,
              "fromMinute": 0,
              "toHour": 14,
              "toMinute": 0
            }
          ],
          "tariff_content_seasons_Winter_fromDay": 0,
          "tariff_content_seasons_Winter_toDay": 0,
          "tariff_content_seasons_Winter_fromMonth": 0,
          "tariff_content_seasons_Winter_toMonth": 0,
          "tariff_content_sell_tariff_name": "Weekenf (edited)",
          "tariff_content_sell_tariff_utility": "Amber",
          "tariff_content_sell_tariff_daily_charges": [
            {
              "amount": 0,
              "name": "Charge"
            }
          ],
          "tariff_content_sell_tariff_demand_charges_ALL_ALL": 0,
          "tariff_content_sell_tariff_energy_charges_ALL_ALL": 0,
          "tariff_content_sell_tariff_energy_charges_Summer_OFF_PEAK": 0.05,
          "tariff_content_sell_tariff_energy_charges_Summer_ON_PEAK": 0.35,
          "tariff_content_sell_tariff_energy_charges_Summer_PARTIAL_PEAK": 0.1,
          "tariff_content_sell_tariff_energy_charges_Summer_SUPER_OFF_PEAK": 0,
          "tariff_content_sell_tariff_seasons_Summer_fromDay": 1,
          "tariff_content_sell_tariff_seasons_Summer_toDay": 31,
          "tariff_content_sell_tariff_seasons_Summer_fromMonth": 1,
          "tariff_content_sell_tariff_seasons_Summer_toMonth": 12,
          "tariff_content_sell_tariff_seasons_Summer_tou_periods_OFF_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 0,
              "fromMinute": 0,
              "toHour": 9,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 14,
              "fromMinute": 0,
              "toHour": 16,
              "toMinute": 0
            }
          ],
          "tariff_content_sell_tariff_seasons_Summer_tou_periods_ON_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 17,
              "fromMinute": 0,
              "toHour": 19,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 22,
              "fromMinute": 0,
              "toHour": 22,
              "toMinute": 30
            }
          ],
          "tariff_content_sell_tariff_seasons_Summer_tou_periods_PARTIAL_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 16,
              "fromMinute": 0,
              "toHour": 17,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 19,
              "fromMinute": 0,
              "toHour": 22,
              "toMinute": 0
            },
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 22,
              "fromMinute": 30,
              "toHour": 0,
              "toMinute": 0
            }
          ],
          "tariff_content_sell_tariff_seasons_Summer_tou_periods_SUPER_OFF_PEAK": [
            {
              "fromDayOfWeek": 0,
              "toDayOfWeek": 6,
              "fromHour": 9,
              "fromMinute": 0,
              "toHour": 14,
              "toMinute": 0
            }
          ],
          "tariff_content_sell_tariff_seasons_Winter_fromDay": 0,
          "tariff_content_sell_tariff_seasons_Winter_toDay": 0,
          "tariff_content_sell_tariff_seasons_Winter_fromMonth": 0,
          "tariff_content_sell_tariff_seasons_Winter_toMonth": 0,
          "nameplate_power": 15000,
          "nameplate_energy": 40500,
          "installation_time_zone": "Australia/Brisbane",
          "max_site_meter_power_ac": 1000000000,
          "min_site_meter_power_ac": -1000000000,
          "tariff_content_v2_code": "(edited)",
          "tariff_content_v2_name": "Weekenf (edited)",
          "tariff_content_v2_utility": "Amber",
          "tariff_content_v2_daily_charges": [
            {
              "name": "Charge"
            }
          ],
          "tariff_content_v2_demand_charges_ALL_rates_ALL": 0,
          "tariff_content_v2_energy_charges_ALL_rates_ALL": 0,
          "tariff_content_v2_energy_charges_Summer_rates_OFF_PEAK": 0.15,
          "tariff_content_v2_energy_charges_Summer_rates_ON_PEAK": 0.5,
          "tariff_content_v2_energy_charges_Summer_rates_PARTIAL_PEAK": 0.38,
          "tariff_content_v2_energy_charges_Summer_rates_SUPER_OFF_PEAK": 0.04,
          "tariff_content_v2_seasons_Summer_fromDay": 1,
          "tariff_content_v2_seasons_Summer_toDay": 31,
          "tariff_content_v2_seasons_Summer_fromMonth": 1,
          "tariff_content_v2_seasons_Summer_toMonth": 12,
          "tariff_content_v2_seasons_Summer_tou_periods_OFF_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "toHour": 9
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 14,
              "toHour": 16
            }
          ],
          "tariff_content_v2_seasons_Summer_tou_periods_ON_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "fromHour": 17,
              "toHour": 19
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 22,
              "toHour": 22,
              "toMinute": 30
            }
          ],
          "tariff_content_v2_seasons_Summer_tou_periods_PARTIAL_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "fromHour": 16,
              "toHour": 17
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 19,
              "toHour": 22
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 22,
              "fromMinute": 30
            }
          ],
          "tariff_content_v2_seasons_Summer_tou_periods_SUPER_OFF_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "fromHour": 9,
              "toHour": 14
            }
          ],
          "tariff_content_v2_sell_tariff_name": "Weekenf (edited)",
          "tariff_content_v2_sell_tariff_utility": "Amber",
          "tariff_content_v2_sell_tariff_daily_charges": [
            {
              "name": "Charge"
            }
          ],
          "tariff_content_v2_sell_tariff_demand_charges_ALL_rates_ALL": 0,
          "tariff_content_v2_sell_tariff_energy_charges_ALL_rates_ALL": 0,
          "tariff_content_v2_sell_tariff_energy_charges_Summer_rates_OFF_PEAK": 0.05,
          "tariff_content_v2_sell_tariff_energy_charges_Summer_rates_ON_PEAK": 0.35,
          "tariff_content_v2_sell_tariff_energy_charges_Summer_rates_PARTIAL_PEAK": 0.1,
          "tariff_content_v2_sell_tariff_energy_charges_Summer_rates_SUPER_OFF_PEAK": 0,
          "tariff_content_v2_sell_tariff_seasons_Summer_fromDay": 1,
          "tariff_content_v2_sell_tariff_seasons_Summer_toDay": 31,
          "tariff_content_v2_sell_tariff_seasons_Summer_fromMonth": 1,
          "tariff_content_v2_sell_tariff_seasons_Summer_toMonth": 12,
          "tariff_content_v2_sell_tariff_seasons_Summer_tou_periods_OFF_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "toHour": 9
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 14,
              "toHour": 16
            }
          ],
          "tariff_content_v2_sell_tariff_seasons_Summer_tou_periods_ON_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "fromHour": 17,
              "toHour": 19
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 22,
              "toHour": 22,
              "toMinute": 30
            }
          ],
          "tariff_content_v2_sell_tariff_seasons_Summer_tou_periods_PARTIAL_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "fromHour": 16,
              "toHour": 17
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 19,
              "toHour": 22
            },
            {
              "toDayOfWeek": 6,
              "fromHour": 22,
              "fromMinute": 30
            }
          ],
          "tariff_content_v2_sell_tariff_seasons_Summer_tou_periods_SUPER_OFF_PEAK_periods": [
            {
              "toDayOfWeek": 6,
              "fromHour": 9,
              "toHour": 14
            }
          ],
          "tariff_content_v2_version": 1,
          "vpp_backup_reserve_percent": 0
        }
      }
    ],
    "scopes": [
      "openid",
      "offline_access",
      "user_data",
      "vehicle_device_data",
      "vehicle_cmds",
      "vehicle_charging_cmds",
      "energy_device_data",
      "energy_cmds"
    ]
  }
}

Exception in error handling in charge port controls

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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'".

Reproduction steps

  1. Click open charge port
  2. Quickly(!) click close charge port

Debug logs

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': ''}}

1.7.4: Enablement of streaming sensor entities

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Some streaming values are coming though, such as SOC:
image

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.

Screenshot 2024-03-15 20 47 11
Screenshot 2024-03-15 20 45 33

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"}

Reproduction steps

No response

Debug logs

No response

Debug mode verbose logging

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

Reproduction steps

Enable integration debug mode.

image

Debug logs

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)

navigation_gps_request / navigation_request REST commands

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

Could we get a service to call to send location addresses (navigation_request) or coordinates (navigation_gps_request) to our vehicles?

Additional context

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.

1.7.4: ChargerPhases > 1 check failing

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Not yet seeing the stream entities appear in Home Assistant

Looks like the ChargerPhases > 1 check is failing.

Debug logs

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'

Seat heater don't work

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The seat heater select entities don't work.

Reproduction steps

No response

Debug logs

No response

Call:service switch:turn_on against switch.mycar_charge while it is already on gives error

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Manipulating the charger switch.mycar_charge works as expected in the UI. However, if the call: service switch.turn_on automation action is called while the switch is already on, the following error popup is given when manually running the automation action:

"Error running action
is_charging"

if calling the service via the developer tools screen, this is displayed at the bottom instead:

"Failed to call service switch.turn_on. is_charging"

Calling the switch.turn_on service while the switch is off proceeds as expected and without error.

The same error/issue exists for calling switch.turn_off if switch.mycar_charge is already off.

Reproduction steps

  1. Ensure switch.mycar_charge is in the "on" position
  2. Call service switch.turn_on against switch.mycar_charge
  3. Note error popup

or

  1. Ensure switch.mycar_charge is in the "off" position
  2. Call service switch.turn_off against switch.mycar_charge
  3. Note error popup

Debug logs

Not seeing anything relevant in homeassistant.log, even with teslemetry custom component debugging turned on.

in System > Logger, there are these entries:


Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:797
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:49:37 (3 occurrences)
Last logged: 07:56:50

[129220410837184] is_charging
[129219800871744] is_charging

and

Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:1934
First occurred: 07:49:37 (3 occurrences)
Last logged: 07:56:50

websocket_api script: Error executing script. Error for call_service at pos 1: is_charging

Time to full charge is always current dateTime if Tesla sends time_to_full_charge = 0.0

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

Reproduction steps

  1. Check via postman that the field charge_state.time_to_full_charge is 0.0
  2. Reload the integration
  3. Notice that sensor._time_to_full_charge gets the current date time.

Debug logs

No response

New (calculated) Sensor: BrickVoltageDelta

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

It's possible to stream fields BrickVoltageMin and BrickVoltageMax directly to HA using this integration.
Creating new template sensor to substract one from another creates entity that is outside of "device" section in integrations overview.

Exposing calculated BrickVoltageDelta by integration solves observability issue while makes it visible in 'Devices' section along other sensors

Describe the solution you'd like

Create new sensor, BrickVoltageDelta that substracts BrickVoltageMin from BrickVoltageMax.
When those fields are not streamed, set state Unknown and add attribute Reason: both BrickVoltageMin, BrickVoltageMax have to be streaming using Fleet Telemetry or something like that

Additional context

No response

FR/question: Sensor for current driver profile in use?

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Is there an existing sensor for which driver profile is in currently in use? I.e. if the car has an "Alice" profile, and a "Bob" profile, can we get which one is selected at that time? Obviously controlling it would be even better (i.e. to pre-set the driver seat position before departure), but even being able to read which profile is active could help with intelligently routing notifications. I looked through the Tesla Fleet API doc and could not find this data exposed, but wondered if there is a field that is exposed but not documented?

Additional context

No response

Energy Controls are not functional

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

image

image

image

Reproduction steps

  1. Calling commands from the GUI

Debug logs

No response

Home Link

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Can you add support for activating Home Link please?

Describe the solution you'd like

Home Link activation

Describe alternatives you've considered

None

Additional context

Nothing

wall_connectors: TypeError: string indices must be integers, not 'str'

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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'

Reproduction steps

...

Debug logs

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
      }
    ]
  }

Boombox does not work

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

Reproduction steps

  1. click fart button

Debug logs

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'

UnboundLocalError prevents integration setup & loading

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

Reproduction steps

  1. Start Home assistant
  2. Integration fails to start
  3. Check logs and it throws an UnboundLocalError
  4. Inside init.py

Debug logs

No response

Valet Mode switch isn't working

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Turning the Valet Mode switch on/off isn't working. The error below appears every time it is switched.

Reproduction steps

  1. Turn Valet Mode on or off
    ...

Debug logs

VehicleSpecific.set_valet_mode() missing 1 required positional argument: 'password'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/trace.py", line 284, in async_wrapper
    await func(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 952, in _async_repeat_step
    await async_run_sequence(iteration)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 856, in async_run_sequence
    await self._async_run_script(script)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1210, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/teslemetry/switch.py", line 192, in async_turn_off
    await self.handle_command(self.entity_description.off_func(self.api))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/switch.py", line 56, in <lambda>
    off_func=lambda api: api.set_valet_mode(on=False),
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: VehicleSpecific.set_valet_mode() missing 1 required positional argument: 'password'

HA sees sensor value as string, not float

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

IMG_1283

Reproduction steps

  1. In Teslemetry console configure streaming of battery temperature
  2. In Home Assistant enable sensor representing that particular measurement
  3. Watch for values shown by HA

Debug logs

N/A

Statistics missing from vehicle EnergyRemaining streaming entity

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

I seem to be missing statistics from the EnergyRemaining sensor.

image

I can see history for this entity:

image

Reproduction steps

No response

Debug logs

No response

1.7.4: homeassistant.exceptions.HomeAssistantError: Could not wake up vehicle

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.
image

Reproduction steps

No response

Debug logs

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

charge_cable state is inverted

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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)

Reproduction steps

  1. Check the value of binary_sensor.carname_charge_cable
  2. Plug or unplug the charging cable
  3. Observe that the sensor is when no cable is connected
    ...

Debug logs

No response

Speed Limit number entity is always MPH

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

The Speed Limit number entity is not shown in local units or the vehicles unit of speed.

Describe the solution you'd like

Change to the Home Assistant local units

Describe alternatives you've considered

None

Additional context

None

Vent Windows cover isn't working

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The Vent Windows cover is always showing as unavailable. When I click the open/close button I get the error below.

Reproduction steps

  1. Vent Windows cover is unavailable
  2. Open/Close gives error below
    ...

Debug logs

2024-05-18 16:39:15.957 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546328350144] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/teslemetry/helpers.py", line 36, in handle_command
    result = await command
             ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tesla_fleet_api/vehiclespecific.py", line 344, in window_control
    return await self._parent.window_control(self.vin, command, lat, lon)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tesla_fleet_api/vehicle.py", line 604, in window_control
    return await self._request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tesla_fleet_api/teslemetry.py", line 69, in _request
    return await super()._request(method, path, params, json)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tesla_fleet_api/teslafleetapi.py", line 117, in _request
    await raise_for_status(resp)
  File "/usr/local/lib/python3.12/site-packages/tesla_fleet_api/exceptions.py", line 282, in raise_for_status
    raise Forbidden(data)
tesla_fleet_api.exceptions.Forbidden: Access to this resource is not authorized, developers should check required Scope.

The above exception was the direct cause of the following exception:

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 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/teslemetry/cover.py", line 74, in async_open_cover
    await self.handle_command(self.api.window_control(command=WindowCommand.VENT))
  File "/config/custom_components/teslemetry/entity.py", line 212, in handle_command
    return await handle_vehicle_command(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/helpers.py", line 45, in handle_vehicle_command
    result = await handle_command(command)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/helpers.py", line 38, in handle_command
    raise HomeAssistantError(f"Teslemetry command failed, {e.message}") from e
homeassistant.exceptions.HomeAssistantError: Teslemetry command failed, Access to this resource is not authorized, developers should check required Scope.

Access DRIVER support

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

Make sure that accounts with DRIVER access can (partialy) use this integration.

Additional context

No response

Service call to navigation_request endpoint gives various errors

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Attempting to use the teslemetry.navigation_request service call in HA results in various errors depending on what values are filled or not

Reproduction steps

  1. Use curl to verify working command syntax for /command/navigation_request endpoint
  2. Use HA developer call service screen using the same data
  3. Note error

Examples of service call YAML variations that I tried:

service: teslemetry.navigation_request
data:
  device_id: MYDEIVICESTRING
  type: "share_ext_content_raw"
  value: "Telluride, CO, USA"
  locale: "en-US"
service: teslemetry.navigation_request
data:
  device_id: MYDEIVICESTRING
  type: "share_ext_content_raw"
  value: "Telluride, CO, USA"
  locale: "en-US"
  timestamp_ms: 1716060381572
service: teslemetry.navigation_request
data:
  device_id: MYDEIVICESTRING
  type: "share_ext_content_raw"
  value: "{
    \"android.intent.extra.TEXT\": \"Telluride, CO, USA\"
  },"
  locale: "en-US"
  timestamp_ms: 1716060381572

Debug logs

With timestamp_ms set:

Error message in UI is "Failed to call service teslemetry.navigation_request. extra keys not allowed @ data['timestamp_ms']. Got None"

2024-05-18 13:16:50.056 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['timestamp_ms']
2024-05-18 13:16:50.056 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [124545501773248] Error handling message: extra keys not allowed @ data['timestamp_ms']. Got None (invalid_format) MYUSER from MYIP (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36)





With timestamp_ms not set:

Error message in UI is: "Failed to call service teslemetry.navigation_request. Unknown error"


2024-05-18 13:19:40.473 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: VehicleSpecific.navigation_request() got an unexpected keyword argument 'value'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/services.py", line 153, in navigate_request
    vehicle.api.navigation_request(
TypeError: VehicleSpecific.navigation_request() got an unexpected keyword argument 'value'
2024-05-18 13:19:40.475 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [124545501773248] Error handling message: Unknown error (unknown_error) MYUSER from MYIP (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/services.py", line 153, in navigate_request
    vehicle.api.navigation_request(
TypeError: VehicleSpecific.navigation_request() got an unexpected keyword argument 'value'

none entities

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Integration seems to create lots of entities with none in the name for both vehicle and energy products.

image

Charge Limit temporarily snaps back to previous value after user input

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

After manually inputting a value for the number.mycar_charge_limit, the command does get set (verified in the Tesla mobile app), but for up to 60 seconds, the old value for this entity is displayed in home assistant. Looking at the debug log, this appears to be old data being echoed back with latency via teslemetry_stream event(s). After about a minute (next teslemetry_stream update?) the new updated value does get displayed. This is a little confusing as is, but gets way worse if making multiple changes to the value within that 60 second window. I believe a race condition ends up happening between the original value, first changed value, subsequent changed value, and "updated from car" values coming back via API.

I would assume this issue may affect other entities as well, but I have not tested other ones.

Found this bug using software / firmware versions:

HA Core (docker container) 2024.5.2
HA UI 20240501.1
Hass-teslemetry custom integration 1.9.3
Connecting to 2023 MYLR (HW3), 2024.2.2

Reproduction steps

  1. Note current charge_limit value
  2. Change charge limit value (note that value is displayed with an additional decimal point)
  3. Wait a few seconds
  4. Note that the previous value is now displayed in the Charge Limit entity input box (with integer precision)
  5. Wait up to 60 seconds
  6. Note new value is finally displayed in the Charge Limit entity input box
    ...

Debug logs

Sanitized (items with *** redacted for privacy/security ***) debug log available at https://pastebin.com/LS9Pm7Jp

FR: don't force number entities UI presentation to be "box"

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

the number.mycar_charge_limit and number.mycar_charge_current are forced by code to be presented as a digital input box by the following line :

Describe the solution you'd like

However, the "slider" is much easier to use in my opinion, and that option is unlocked by not forcing the input to be a box. Consider changing this line to

mode=NumberMode.auto,

Which is in-line with recommended practice in HA documentation.

Additional context

Relevant HA entity documentation:

https://developers.home-assistant.io/docs/core/entity/number/

Window controls do not work

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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.

Reproduction steps

  1. click close windows

Debug logs

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'

Request - keep state after HA restart, or force car awake on startup to get data

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

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.

Additional context

No response

Trunk command doesn't work

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

It seems trunks are broken in the Python library

Reproduction steps

...

Debug logs

No response

Could wall connector card display vehicle name

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Currently Wall Connector integration shows the VIN of the connected vehicle.

image

Describe the solution you'd like

Could it also show the vehicle display_name aka Tesla App please?

image

image

Additional context

No response

Integrating python scripts for more complex calculations on energy products/ powerwall

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

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)

Describe the solution you'd like

Interested in methods of accessing these via telemetry, maybe switching to the fleet-api library?

Additional context

No response

2024 Model 3 doesn't have a middle rear seat heater

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

The Highlander doesn't have a middle seat heater.

Describe the solution you'd like

Figure out if the vehicle has 2 or 3 rear seat heaters and disabled the middle one appropriately.

Describe alternatives you've considered

Disable it manually.

Additional context

None

Device registry firmware version doesn't seem to update

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

It would appear that the device registry isn't being updated with firmware revisions.

Screenshot 2024-05-07 17 14 01

Taken from the vehicle_data endpoint:

"vehicle_state": {
                "api_version": 75,
                "autopark_state_v2": "standby",
                "autopark_style": "standard",
                "calendar_supported": true,
                "car_version": "2024.8.9 0cac3042b6cd",

Yes this Intel vehicle is stuck with .14, my my other Rizen vehicle looks very nice.

Reproduction steps

  1. Check firmware in registry

Debug logs

No response

wall connector: State and Fault state seen as string, not int

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Screenshot 2024-03-26 at 14 08 54

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.

Reproduction steps

No response

Debug logs

No response

Time to Arrival and Distance to Arrival incorrect when not navigating

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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

  • active_route_miles_to_arrival
  • active_route_minutes_to_arrival
    are dissapearing. So I would expect that the 2 sensors Time To Arrival and Distance To Arrial become both unavailable in HA.

Using release 1.4.6

Reproduction steps

  1. Navigate to an address
  2. Once arrived observe that with each sensor update the time of arrival changes with the currentDateTime

Debug logs

No response

Model details for Powerwall

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Powerwall comes up as unknown model in devices section:

Screenshot 2024-04-02 14 19 18

Describe the solution you'd like

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
        },

Additional context

No response

Entity from integration teslemetry has state class total_increasing, but its state is not strictly increasing

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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

Reproduction steps

No response

Debug logs

No response

Polling interval / Sleep

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

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?

Describe the solution you'd like

I'd like to see my car sleep which it hasn't done for a while using a previous HA integration.

Describe alternatives you've considered

Other HA projects

Additional context

None

Additional vehicle endpoints

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I use some additional vehicle end points in my integrations.

Describe the solution you'd like

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

Additional context

No response

energy_added state class total increasing

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

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

Reproduction steps

No response

Debug logs

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

Using service to set number.mycar_charge_limit to its current value gives error, blocks automation

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Use call: service number:set on number.mycar_charge_limit to its current value returns an error "already_set". This blocks automations from proceeding.

Temporary workaround is to check the value of the charge limit in the automation before setting it, but this is unnecessary extra work. The integration should allow the existing value to be "set" (no change) and return no error instead.

Reproduction steps

  1. Note current number.mycar_charge_limit setting
  2. Use automation call service action (or developer call service) number:set on number.mycar_charge_limit with value chosen to be the existing value
  3. Note error "already set" is returned, which blocks automations from proceeding
    ...

Debug logs

Nothing relevant in homeassistant.log (even with Teslemetry debug logging on), nor System > Logs

Energy remaining sensor - no statistics found

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The EnergyRemaining sensor (populated though streaming) doesn't maintain statistics, even though it is class measurement.

image

By comparison and what is expected such as the PackVoltage sensor.

image

Or even the EnergyAdded sensor.
image

Reproduction steps

No response

Debug logs

No response

ClimateEntityFeature issues

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The debug log report ClimateEntity issues for Teslemetry to be reported upstream.

Reproduction steps

No response

Debug logs

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

1.7.4: ignored_variance check for ACChargingEnergyIn is failing.

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

A different TypeError with the stream implementation

Looks like the ignored_variance check for ACChargingEnergyIn is failing.

Reproduction steps

No response

Debug logs

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.