Updating Sol-Ark inverter settings from HomeyScript

I have a Solar/Battery system on my house that is controlled by a Sol-Ark 15k hybrid inverter. I was looking for a method to change the inverter settings from my Homey setup based on weather events. Unfortunately, there is no App for this, nor is there likely to be one, so I decided to try and accomplish it by developing a HomeyScript to use the web interface to the inverter.
I’m still working through it, but I expect by the end of the weekend I should have a script that can be used to change the settings that control battery charging and usage into a pre-set configuration. I’ll have one for “storm prep” for days when we’re expecting significant weather that may result in short-term power outage. I’ll have another to reset to “normal” use. Another for emergency situations like Hurricane events. I intend to trigger the appropriate script based off of weather alert events.

I also do several other things during grid-outage events to reduce power usage, like switch the HVAC system off. I can still override manually, but I don’t want that eating up my batteries unless I intend to. This script will become a part of that grid-outage flow.

I don’t know if anyone else out there is using a Sol-Ark, but I’d be happy to share this once it’s working properly.

Very interesting, Jeffrey. I don’t use Sol-Ark myself, but your approach seems more flexible than an app. Thanks for sharing; this approach could potentially work for an Ecoflow battery as well.

I considered trying to develop and app, but I’m not really a software developer. I’ve done a lot of scripting, though, and what I wanted to be able to do is have some static combinations of settings for my inverter for different conditions and just swap those in/out depending on seasons, weather conditions, etc. This method is subject to the risk of the Sol-Ark web developers making changes to their API’s, but it’s a dedicated hardware configuration web site. The hardware isn’t changing, so I suspect that the underlying API calls are unlikely to change often. If they do, I can adapt, but I’m betting I’m on fairly stable ground.

An update that would take me 5 minutes or more of focused use of the web site I can now execute with a button press in my Homey app, and better yet automate. The script executes in about 10 seconds. I’m pretty pleased with the outcome. It appears to be solidly working without fail. I could add the ability to tweak the values from Homey Variables if I want, but I’m not sure it’s worth the effort. I can just directly edit them in the script. I now have a script with each season covered, and one for “storm prep” that charges the batteries to 100%. The storm one is in a flow that asks me after 24 hours if I want to keep it in that mode or revert to normal.

Being able to use the Homey Flows to handle the automation and triggering events is powerful.

EDIT: The process I used was surprisingly simple. Basically, a combination of using Chrome Developer Tools to record network traffic as I performed the web site changes I wanted to script (including site login), then uploaded that information to the Claud AI, asking it to create a JavaScript optimized for use as a HomeyScript. It took a fair amount of back and forth, but mostly because I had never used that kind of resource. Figuring out what to feed it as a prompt was the biggest issue. What resulted was a fairly clean understandable script.