-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tesla Fleet Needs device_class type Energy #124671
Comments
Hey there @Bre77, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) tesla_fleet documentation |
Download |
@eddy-r the information provided by Tesla is power, not energy. Changing the device_class will make it show up in the energy dashboard, but the information will be incorrect. You need to create an |
@Bre77 exactly right, the information provided by Tesla is power, but a full integration for Home Assistant should provide the data points for useful features within Home Assistant. If this have been posted under feature request, please feel free to move it. I have it working and showing data in the Energy tab, but it took some delving into the inner workings of the system. For instance, Tesla Fleet provides power as a single number, with a positive number meaning flow of power away from the given source (whether it's the grid, battery, or panels), and a negative value being power flowing towards the source of the reading. Taking this and producing a straight-forward integration helper that also shows positive and negative kWh is not what the Energy tab expects. First, I had to split the data from the grid and battery power into positive-only values. For example, To extract the positive value from Rinse and repeat for the battery, and create an integration helper for the solar panels, and it was done, but only after trial and error. After setting the Device section to the Tesla Fleet device name ("My Home" by default), all of these show up as entities and sensors for the device. Isn't it possible to set this up programmatically so that users don't each have to go hunting for how to do those steps? |
It sure is, but as far as I am aware Home Assistant has rules against me doing it in the integration itself. I've asked the question on Discord because if I am allowed to then I defintely will for Tessie, Teslemetry, and Tesla Fleet. |
update: there was a communication issue with gateway seems to be functioning but the kwh data sensor isn't reporting any data even though the fleet sensor shows it
sensor:
|
Hey - so total novice first time user of HA which I primarily purchased for energy tracking to start with. I have the Tesla Fleet connected and obviously ran into the same problem as I was trying to setup the energy dashboard. I really tried my best to understand what was done in this thread but honestly getting nowhere. Would it be too much to ask for steps to create these sensors so I could use them in the energy dashboard? Thanks. |
No that's a really good idea, I'll add a section to the documentation. |
That would be so awesome and maybe stop me returning my HA green box So for the silly, does that mean I will find it at the bottom of https://www.home-assistant.io/integrations/tesla_fleet once you add it? (Please write for the stupid) |
Documentation was updated with high level information, however we are working on adding actual history data for the energy dashboard now. |
Thanks for that, I did see that but will need to take time as thats still above my current 0 education level. Actual history data --> does that mean above steps not required or this is for something else? |
While we wait on official documentation, I've put together my method to get the Energy Dashboard and Tesla Fleet talking to each other here. Please feel free to use this if it helps get instructions going. |
cool thanks will try to dig into it tomorrow, it should be fine if we don't have a powerwall and just solar? |
It should work without the Powerwall information in the Energy dashboard. I guess I named the file the way I did because I have a Powerwall and wanted something that would work completely offline. This is the closest I could get.
If you ignore all the Powerwall settings you should be able to get the Energy dashboard working with these instructions. I should rename the file "Tesla Fleet and the Energy dashboard."
…________________________________
From: gatsntatsdad ***@***.***>
Sent: Wednesday, September 18, 2024 10:37:07 PM
To: home-assistant/core ***@***.***>
Cc: Eddy Redondo ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Tesla Fleet Needs device_class type Energy (Issue #124671)
While we wait on official documentation, I've put together my method to get the Energy Dashboard and Tesla Fleet talking to each other here<https://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub>. Please feel free to use this if it helps get instructions going.
cool thanks will try to dig into it tomorrow, it should be fine if we don't have a powerwall and just solar?
—
Reply to this email directly, view it on GitHub<#124671 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPXJ23TOUSBLHD2OJLTLWTZXI2FHAVCNFSM6AAAAABNFJUBESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZHA3DANBWGA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@eddy-r this was exactly what I was looking for, I followed your steps, all the helpers are in, setup the energy board now just in the countdown for the hourly to see if I done it right, bit late here so I am hoping for a nice surprise in the morning. Thank you so much for this. |
@gatsntatsdad, I tested and can confirm that after installing the sensors under Home Assistant version 2024.9.2 this error exists. I just updated to 2024.9.3 and the error does not happen again.
…________________________________
From: gatsntatsdad ***@***.***>
Sent: Tuesday, September 24, 2024 2:41:23 PM
To: home-assistant/core ***@***.***>
Cc: Eddy Redondo ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Tesla Fleet Needs device_class type Energy (Issue #124671)
Screenshot.2024-09-24.at.11-37-27.Settings.Home.Assistant.png (view on web)<https://github.com/user-attachments/assets/29c4758d-7951-48b1-b376-49b3c42ef087>
—
Reply to this email directly, view it on GitHub<#124671 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPXJ26JWAMJ3B5VP6WT6MLZYGW5HAVCNFSM6AAAAABNFJUBESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZSGAZTENRSG4>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@eddy-r So getting figures and looking ok, just trying to get my head around understanding the numbers and checking them. The energy flow I assume is an accumulation rather than a live view? my energy configuration is showing an error re negative figure, attaching image |
so there is still something wrong, my energy panel is showing no data (its been 3+ hours since setting it up) not sure if i set it up wrong or what but in the 'master' panel it shows data for the tesla entities but nothing is getting to the energy panel |
@jeegnesh-patel it looks to me like you may have copied something wrong during the process. I have updated my process with additional notes to help catch errors. |
Looking at your list of sensors, you may have created an extra sensor that wasn't needed for the solar panels. Also, the grid export and grid import template sensors don't look like they are reading from your Grid power sensor. I've edited my process with additional notes to help catch errors. You many need to delete these sensors and start over. |
thanks, i think i figured it out, i'd removed the ' ' around the sensor entities because i mistakenly assumed the quotes weren't necessary and just denoted what needed to be replaced with my values (i'm completely new to css coding) |
Nice, went thru again - I think I found one issue, my internal sensor has measurement as kwh your doc states hours, this actually seems to be on all sensors, when I try to change it only power types appear, hours is not an option -- I am sure I set it up as hours on all, could you check when you edit yours what it says? |
ok, i have no idea whats going on, but now my panels and sensors are all wacked out, attached is the tesla fleet panel information (i'd fixed the decimal place the other day and now it's even more messed up) and my tesla app screen showing it's information, also sometimes when i open the energy panel it shows wildly different data/trends, especially on different devices... |
I’d write a longer explanation, but I had shoulder surgery today and I’m one-handed, so the short explanation is that this is normal from what I see on your screenshots. Two things to compare:
1. The Sensors reading kW, such as your Grid Export kW showing 1.2 kW, should match their equivalent sensor on the Tesla app main screen (the GRID reading in this sensor’s case).
2. The Sensors reading kWh will not match without some filtering. This is because the Tesla app screenshot you have has already filtered the reading to a date range, while Home Assistant does not filter it in the Sensors list. The Energy tab in Home Assistant does this filtering automatically like the Tesla app does. You could filter it on the Sensors list by clicking the sensor and then selecting Show More and setting the date and time to match the Tesla app. Keep in mind that because of latency and how often Tesla Fleet is allowed to read the sensors online (they are not read directly from your gateway, battery, or whichever device reports the reading), there will always be a difference between Home Assistant’s reading and what’s reported on the Tesla App. In fact, I’m working with my installer because the Tesla app overreported how many kWh I used by 200 compared to my meter.
…________________________________
From: gatsntatsdad ***@***.***>
Sent: Thursday, September 26, 2024 8:26:43 PM
To: home-assistant/core ***@***.***>
Cc: Eddy Redondo ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Tesla Fleet Needs device_class type Energy (Issue #124671)
ok, i have no idea whats going on, but now my panels and sensors are all wacked out, attached is the tesla fleet panel information (i'd fixed the decimal place the other day and now it's even more messed up) and my tesla app screen showing it's information, also sometimes when i open the energy panel it shows wildly different data/trends, especially on different devices...
Screenshot.2024-09-26.at.17-21-10.Settings.Home.Assistant.png (view on web)<https://github.com/user-attachments/assets/b7f9d7f8-7c18-49dd-aa35-008237a6c440>
26861.jpeg (view on web)<https://github.com/user-attachments/assets/201cf343-621e-47d0-b68d-fa0b6367b978>
—
Reply to this email directly, view it on GitHub<#124671 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPXJ25TOZ26EHQEWURAC33ZYSQ4HAVCNFSM6AAAAABNFJUBESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZYGE3TGOJTGE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
sorry about your shoulder man, speedy recovery i get that there is latency and therefore a slight difference in values, but i'm not sure how reading hundreds of millions of kW is normal? |
Delete the two sensors and Rex add them if you think you might have had a bad prefix in there at any point. I remember doing something dumb like that and winding up with kkWh readings at some point. I didn’t wait to see what reading it gave. I do know it was easier to delete and recreate the sensor than to fix it.
To delete a sensor, I go to Settings -> Devices & services -> Helpers. Select the sensor, click the settings gear, and select Delete at the bottom.
…________________________________
From: gatsntatsdad ***@***.***>
Sent: Thursday, September 26, 2024 11:27:34 PM
To: home-assistant/core ***@***.***>
Cc: Eddy Redondo ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Tesla Fleet Needs device_class type Energy (Issue #124671)
sorry about your shoulder man, speedy recovery
i get that there is latency and therefore a slight difference in values, but i'm not sure how reading hundreds of millions of kW is normal?
everything worked and displayed fine after fixing the ' ' issues 2 days ago that i'd messed up initially, but it's gone increasingly insane per the screen shots, the numbers are flying up in a blur
—
Reply to this email directly, view it on GitHub<#124671 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPXJ27W6VPBLTW2VB5GFL3ZYTGCNAVCNFSM6AAAAABNFJUBESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZYGMZTEMRZHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
ok i'll give that a try tomorrow thanks |
ok i deleted the sensors (i did it thru the listing in tesla fleet device though....) and followed all the directions again to create, this is what i've got, not sure why templates and integral sensors is doubled up, they each contain the exact same entities... |
Any ideas on this one? |
I'm going to try and understand what the question is, so please clarify if I don't answer your actual question. The only sensors that have hours listed as a unit of measure are the integral sensors' time unit. Once set, this value is not available for editing and not visible from any of the screens I have tried to access it. Once created, the unit of measurement becomes kWh, which is a combination of the sensor it is taking its readings from (measure of power in kW) and the unit of time selected. The correct unit of measure for an integral sensor is kWh. I cannot speak for what corrections can be made after creating the sensors, because I found it best to delete and recreate a sensor if I made a bad selection at some point during the creation process.
…________________________________
From: jeegnesh-patel ***@***.***>
Sent: Monday, September 30, 2024 10:18:51 AM
To: home-assistant/core ***@***.***>
Cc: Eddy Redondo ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Tesla Fleet Needs device_class type Energy (Issue #124671)
my process<https://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub>
Nice, went thru again - I think I found one issue, my internal sensor has measurement as kwh your doc states hours, this actually seems to be on all sensors, when I try to change it only power types appear, hours is not an option -- I am sure I set it up as hours on all, could you check when you edit yours what it says?
Any ideas on this one?
—
Reply to this email directly, view it on GitHub<#124671 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPXJ267MIUNXFI3PJPB6GLZZFMUXAVCNFSM6AAAAABNFJUBESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBTGM2DIOBTHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
so i'm still having 'unknown' and 0 values for grid export, i'd deleted everything and started over, other than this set of metrics everything appears to be working properly |
That's unusual. When you recreate those sensors, their new kWh should start at zero.
…________________________________
From: jeegnesh-patel ***@***.***>
Sent: Monday, September 30, 2024 12:07:25 PM
To: home-assistant/core ***@***.***>
Cc: Eddy Redondo ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Tesla Fleet Needs device_class type Energy (Issue #124671)
Got you, so I deleted and recreated, unless you need to wait for the data to refresh/repull it all looks the same, so the issue is negative numbers for battery storage:-
Screenshot.2024-09-30.at.17.05.08.png (view on web)<https://github.com/user-attachments/assets/807b33d9-6e97-4d37-8b33-4916ee831390>
Here the custom sensors readings
Screenshot.2024-09-30.at.17.04.04.png (view on web)<https://github.com/user-attachments/assets/9d568735-2de6-4137-8583-68fe9a27f752>
—
Reply to this email directly, view it on GitHub<#124671 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABPXJ22AQUJ3ZP75U6WYLGTZZFZL3AVCNFSM6AAAAABNFJUBESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBTGYYTENBUHA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
i'm still not getting grid export to work, here's shots of the setup, i thought i followed your site exactly, everything else is working properly now after ditching and redoing everything except this |
it's been a bit, can you look at my last post having this issue after using the last recommendation you made |
I'm waiting for someone to review and approve it. Unfortunately I don't really have much control over that. YOU can review and approve it yourself which will help it get noticed by someone on the core team. |
well crap i've been replying to the wrong username, can you look up at my replies to eddy about my issues i'm having with the integration? |
Thanks for this - saved my many hours of head scratching! |
@stromdriver If your having an issue you should raise your own issue on, this one is essentially a feature request which I've already completed. |
oh ok sorry |
@eddy-r Thank you for much for the documentation! |
The problem
When configuring the Energy tab, adding a Grid Consumption sensor does not list any sensor from the Tesla Fleet sensors. Following the help link (https://www.home-assistant.io/docs/energy/faq/#troubleshooting-missing-entities) explains that power is measured in Watts and energy in kiloWatt-hour.
Tesla Fleet provides sensors for grid_power, load_power, solar_power, and battery_power with a unit of measure of kW and a device_class of power.
In order to use the information from these sensors in the Energy tab, the device_class needs to be energy. The state_class must be total or total_increasing. The unit_of_measure should be kWh.
These sensors cannot currently be used in the Energy tab as they are.
What version of Home Assistant Core has the issue?
core-2024.8.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tesla Fleet
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tesla_fleet
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
To reproduce, simply add a Tesla account with a solar system and attempt to add the consumption information.
The text was updated successfully, but these errors were encountered: