Getting info from Tesla Gateway Battery State of Charge and Power status to run scene

Hi All, I am very new to Luup coding and was wondering if anyone could help with integration of my Tesla Powerwall with Vera so that I can get the battery state of charge value and power values every second based on which I can control certain loads, say switch on hot water cylinder when battery charge is above 95% and the solar is exporting to the grid. When I poll form the Tesla Gateway using the following link in a browser “https://Tesla_Gateway_IP_Address/api/system_status/soe” returns battery charge “https://Tesla_Gateway_IP_Address/api/meters/aggregates”, it returns power values. Anybody here tried something like this or could help me with this please?
Cheers,
Pranay

You can probably resolve it very easily by using site sensor plugin. Search for it here in this forum.

1 Like

Thanks for that. Appreciate that! Will give it a shot and will update here. :slight_smile:

Any update on this? I am getting a powerwall installed this week and would like to be able to trigger scenes when I am on Battery Power (ie Grid town). Scenes to turn off certain lights, etc.

Thanks in advance.

Hi Mark2025, sorry for the late response. No, I was going to try it but didn’t get a chance to do this since then. However, just installed sitesensor and looking at the interface now and definations in the sitesensor blog SiteSensor - Plugin for Vera Home Automation Controllers | toggledbits it is a bit confusing for a non-programmer like me. I wish someone else has successfully tried this already. Attached here screenshots of the interface. I understand what the url field should be but not sure what the “Request Headers” and “Response Pattern” should be. See attached Tesla response for SOE and power pages.

Also, Tesla uses self-signed SSL certificate which may become an issue.

Hi Guys,
Great news! Finally after a long time, I had some time to play with the sitesensor and it was actually quite simple. I have finally managed to automate the hot-water cylinder and a few other heavy appliances based on the Battery SOC and Grid Import/Export values.
Screenshots below for the Grid power import/export functions. Similar process for SOE. Hope that helps.