window.loaded += on_loaded
to
window.events.loaded += on_loaded
Due to a deprecation in pwebview. Maybe I’m using too recent of versions.
[pywebview] loaded event is deprecated and will be removed in 4.0. Use events.loaded instead.
It works!!! Finally setting my mode dynamically. Thanks for all your work here!
Does anyone know if when StormWatch mode is enabled, what we set reserve and Operations mode wise doesn’t matter? That it will ignore our settings unless we turn off StormWatch mode. My worry was that StormWatch mode engages, and then when I dynamically set the mode and charge in an auotmation, it would interfere with StormWatch. But from memory I think it doesn’t matter what the other settings are for Op mode or charge level. It will ignore it if a StormWatch is engaged (which is what I want). Other way around this would be in the automation detect if StormWatch is active (if it is do nothing), but I see no way to detect StormWatch mode.
Thanks to all who’ve posted info on getting this working so far!
I’m very new to HA, but working my way through gradually.
I think i’ve got the integration setup, i’ve put the json file in the config root and all appears to be correct, however, i’m getting the below after rebooting HA.
2022-07-25 11:40:04 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration tesla_gateway which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-07-25 11:40:09 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tesla Gateway for tesla_gateway
AttributeError: module ‘custom_components.tesla_gateway’ has no attribute ‘async_setup_entry’
Thanks you for that I got mine working like a dream.
If some one could help.
I want to set an automation at 10 pm each night to set the reserve value to what ever is left in the battery. So I can use it later the next morning.
Basically the action is what I can’t work out
action:
Set
Tesla Gateway: set_reserve
backup_reserve_percent:
to equal
Get Value of
sensor.powerwall_charge
( be nice to set the value (sensor.powerwall_charge - 5))
Would anyone be willing and able to create this file for me? I’m not a Linux user and find that a bit daunting to be honest, plus I don’ t have a machine to do it on and don’t fancy messing with my RPi 4 as its running my HA server.
From what I understand about the process you would only need my e-mail address for the Tesla Account?
But I would be eternally grateful if anyone can assist, please DM me for details.
P.S. I finally got my PW installed this week after waiting for 12 months for delivery, I have the automations from @BruceH5200 so I’m just short of this file to get the integration to work. Currently after installing the tesla_custom integration and using the SS Token the integration fails to set up. Which I’m hoping is just because of these changes that are required and the file generated in step 4) above…
OK I can try that, what is the line that I enter? I tried just “python3 -m pip install teslapy” and “sudo python3 -m pip install teslapy” but both are bad commands:
if you could help me with the required commands then I will try to do via the HA consul. Does this file have to be regenerated every time the Tesla Token expires? If so then I really do need to know how to do it for myself.
I have removed that post for the other Rpi as it may be easier as Bruce had said to run the terminal commands on my HA machine where all the other information and files are available. However I cant run any commands as ‘sudo’ is not available. I tried to research this but when people asked the same question, “How to run terminal commands in HA” they never seemed to get the actual answer from anyone.
Is it anything to do with my type of installation and is there any work around that if it is?
I can’t fully remember what I did but I did this all from a Microsoft Windows computer. You can download TeslaPly and Python3 from the internet. You will also need to update manifest.json with the version of TeslaPly you download. I will be setting up HA for my father-in-law in the next couple of months so if no one else has done it then I will document and post the whole process down once I have worked it all out again.
Ive set this up on multiple locations to try and get it to work (including Windows etc)
This happens when i call the service - says the call is successful - however this is what i get int he log - no matter what i call - i get an error which suggests i dont have a PowerWall Battery.
I would first check the configuration of the action in your automation.
As an example my Set to 50% Powerwall Reserve automation is configured to call a service. Configuration of the example action is below.
Service
Tesla Gateway: set_operation
Service Data
service: tesla_gateway.set_operation
data: null
real_mode: self_consumption
backup_reserve_percent: 50