alandtse/tesla

Fresh install for Tesla inverter (no powerwall) has unavailable sensors

Open

#713 opened on Sep 12, 2023

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (122 forks)github user discovery
buggood first issuehelp wanted

Repository metrics

Stars
 (741 stars)
PR merge metrics
 (Avg merge 13d 8h) (14 merged PRs in 30d)

Description

Using the latest version, 3.16.1 according to HACS

Issue

I have the integration installed and configured, to pull data from my Tesla solar Inverter (without powewall). It has auto created 3 entities for me,

  • sensor.house_solar_power (working as expected)
  • sensor.house_grid_power (returns as unavailable)
  • sensor.house_grid_power (returns as unavailable)

However, looking at the debug logs below, a lot of useful data IS being returned, but seemingly not being used.

I am trying to calculate the solar power generated, the solar power consumed, the grid power consumed, and the solar power returned to the grid. I need some of the data in the API responses below to make those calculations, and presumably that data should be assigned to the above sensors, but it is not.

Do I have something configured incorrectly?

Debug log

2023-09-12 12:24:30.558 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2023-09-12 12:24:30.558 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: [MY_SITE_ID_HERE]
2023-09-12 12:24:30.559 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:33:41
2023-09-12 12:24:30.559 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/[MY_SITE_ID_HERE]/live_status {}
2023-09-12 12:24:30.765 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":6780,"load_power":828.0703125,"grid_status":"Unknown","grid_services_active":false,"grid_power":-5951.9296875,"grid_services_power":0,"generator_power":0,"island_status":"island_status_unknown","storm_mode_active":false,"timestamp":"2023-09-12T12:24:30-07:00","wall_connectors":[]}}
2023-09-12 12:24:30.766 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.208 seconds (success: True)
2023-09-12 12:24:40.558 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2023-09-12 12:24:40.558 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: [MY_SITE_ID_HERE]
2023-09-12 12:24:40.559 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:33:31
2023-09-12 12:24:40.559 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/[MY_SITE_ID_HERE]/live_status {}
2023-09-12 12:24:40.855 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":6780,"load_power":828.0703125,"grid_status":"Unknown","grid_services_active":false,"grid_power":-5951.9296875,"grid_services_power":0,"generator_power":0,"island_status":"island_status_unknown","storm_mode_active":false,"timestamp":"2023-09-12T12:24:40-07:00","wall_connectors":[]}}
2023-09-12 12:24:40.857 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.299 seconds (success: True)
2023-09-12 12:24:50.558 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2023-09-12 12:24:50.558 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: [MY_SITE_ID_HERE]
2023-09-12 12:24:50.559 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:33:21
2023-09-12 12:24:50.559 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/[MY_SITE_ID_HERE]/live_status {}
2023-09-12 12:24:50.811 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":6780,"load_power":828.0703125,"grid_status":"Unknown","grid_services_active":false,"grid_power":-5951.9296875,"grid_services_power":0,"generator_power":0,"island_status":"island_status_unknown","storm_mode_active":false,"timestamp":"2023-09-12T12:24:50-07:00","wall_connectors":[]}}
2023-09-12 12:24:50.811 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.253 seconds (success: True)
2023-09-12 12:25:00.558 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2023-09-12 12:25:00.558 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: [MY_SITE_ID_HERE]
2023-09-12 12:25:00.559 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:33:11
2023-09-12 12:25:00.559 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/[MY_SITE_ID_HERE]/live_status {}
2023-09-12 12:25:00.920 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":6780,"load_power":828.0703125,"grid_status":"Unknown","grid_services_active":false,"grid_power":-5951.9296875,"grid_services_power":0,"generator_power":0,"island_status":"island_status_unknown","storm_mode_active":false,"timestamp":"2023-09-12T12:25:00-07:00","wall_connectors":[]}}
2023-09-12 12:25:00.920 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.363 seconds (success: True)

Contributor guide