-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add support for energy sites to re-write #250
Conversation
Cabin Overheat Protection, CurrentLimit, ChargeLimit
…nto tesla-rewrite
The native key has always been there. I don't think it's the solution. We should go with the solution provided by the Chinese user. No need optimizing blind. |
Sounds good - I'm not quite sure what the difference is with native_location. Just added the GCJ02 to WGS84 conversion back in with some slight modifications to make it work with the rewrite. |
Ok, for #218, while it may rely on some older teslajsonpy functions, the changes were specifically for HA to enable the Delete Button. We'll want to not lose that. The failing CI for Validate/Hacsfest should resolve once we publish teslajsonpy. I'm a bit more concerned about the failing unit tests. We should at least be on parity for unit testing before we push this out to dev. Once we've done the teslajsonpy release, I'll also put this on a dev system and see if I can help clear out the remaining issues with you. |
Sounds good. I usually don’t have much time on weekdays as I’m sure like most folks, I’m just doing this when I have free time outside of work and family time. I’ll try to take a look at the tests and #218 sometime this week if I can. The coverage was pretty high when I last checked except for init.py and config_flow.py, but I didn’t think they were any less than the current integration. |
Don't forget to bump poetry. See example: #276 |
Whoops, done! I'm hoping to be able to update the tests this weekend. |
Finally tested this. Looks like we're upping the minimum HA version. Please make sure we fix hacs.json to enforce it.
EDIT: Looks like 2022.10.0 home-assistant/core@6002377 |
Thanks. Please note this is live in dev. Users will need to opt in. The plan will be do a full release after 1 week or so. |
This was all @shred86. I can't take any real credit for this. Btw @shred86 , did you point anyone to the dev branch for testing? I haven't seen any new issues and it seems fine from my production server. I didn't check the HA forums though. My plan is to take this live this weekend unless you aren't around to deal with any potential issues. Let me know. Thanks, |
I'm happy to point some eager users from community.homeassistant which is probably a good idea before we go for a wide release, but I'll wait your confirmation. |
@Megabytemb did most of the work honestly. I just continued what he did and redid the teslajsonpy side. I haven’t mentioned the beta yet. @purcell-lab no issues spreading the word. The more folks we can have test the better. If you don’t mind sharing the thread you post in, we can check it if there’s any questions to answer. @alandtse I won’t have much time Saturday but I should be around Sunday. There are a couple minor known issues and I still haven’t added the ability to delete entities yet, but maybe those are things we can add later. |
I have released a post https://community.home-assistant.io/t/add-support-for-tesla-powerwall/142280/309?u=markpurcell Found. |
Thanks. I haven't seen any influx of issues yet, so I'll plan to do the release Friday. That way it'll give some people time to install it and we can address any new issues over the weekend. |
This is now live as 3.0. Congrats @shred86 |
Added support for Tesla energy sites and updates to cars. Requires updates to teslajsonpy submitted in this pull request. This is a breaking change as some naming conventions were changed to align with Home Assistant. Tested on my setup which is a 2015 Tesla Model S 85D and Tesla solar system with a Tesla inverter (no Powerwalls). Please feel free to help out with finishing this rewrite by referencing the "To do" section below.
Breaking Changes
TeslaCarChargerPower
class) for charger power.Changes
TeslaBaseEntity
to a newly createdTeslaCarEntity
.TeslaEnergyEntity
class which also inherits fromTeslaBaseEntity
.TeslaEnergyPowerSensor
class used for creating power sensors (solar, grid, load and battery).TeslaEnergyBattery
class for Powerwall battery percentage sensor.TeslaEnergyBatteryRemaining
class for Powerewall battery Watt hour remaining sensor.TeslaEnergyBackupReserve
class for Powerwall backup reserve percentage setting sensor.TeslaEnergyBatteryCharging
class for Powerwall battery charging binary sensor.TeslaEnergyGridStatus
class for Powerwall grid status binary sensor.TeslaEnergyGridCharging
class for Powerwall grid charging select.TeslaEnergyExportRule
class for Powerwall export rule select.TeslaEnergyOperationMode
class for Powerwall operation mode select.TeslaCarChargerPower
class for car charger power (kW).TeslaCar*
andTeslaEnergy*
for all vehicle and energy site related classes respectively.TeslaCarMileage
toTeslaCarOdometer
.TeslaCarParkingBrake
will indicate "On" when the car is on and in "Park" but also when the car is off (parking brake still engaged).TeslaCarChargerConnection
device class toPLUG
.helpers.py
.TeslaCarOnline
extra state attributes to prevent HA from automatically formatting with commas.Fixes
Known Issues
When turning the HVAC system on from HA, the state of the HVAC entity in HA remains off. If you subsequently turn the HVAC system off from HA, the state of the HVAC entity in HA shows on. What's happening isThe entity state is being updated immediately in teslajsonpy so we're simply refreshing the HA entity state.update_controller
is being called whenasync_set_hvac_mode
is called. We're immediately updating the state in teslajsonpy upon a successful response butupdate_controller
triggers anotherController.update
which returns a response that indicates the HVAC system is off when we just turned it on, and vice versa. It appears we're not giving the Tesla server enough time to write/save the newis_climate_on
status so we're getting the "old" state.00: {"response":{"reason":"cabin comfort remote settings not enabled","result":false}}
even thoughVEHICLE_DATA
shows I do have it enabled,'remote_heater_control_enabled': True
. I can also control seated heats from my Tesla app.homelink_device_count
to determine whether or not to add the HomeLink button, but when the car is asleep it's returningNone
.To do:
Addinclude_vehicle
andinclude_energysite
options into config flow forController.connect