Python code traslation

Is anyone available to translate a function from Python?
It is a script to communicate with SAJ solar inverters.

Have you tried ChatGPT for this? @Sebastien has had good success with this I believe.


chatGPT gave up :slight_smile:

1 Like

Oh Chat Geppetto! Not yet a real boy. :joy:


i tryed whit Cody Chat too but it just give examples

Are you trying to "translate" something from Home Assistant (say, a component/integration) to Hubitat (as an app/driver)? You didn't say, but I'm just guessing based on the programming languages involved. :slight_smile:

ChatGPT can probably handle translating logic. However, it will almost certainly not do well with everything else you'd need to account for, including the vastly different environments and what sort of libraries, etc. are there to support such development. That could by why you're having bad luck.

As an alternative, perhaps you could state specifically what you are trying to do. Then, someone might have an idea of whether something already exists, or, if not and you're lucky, they may be able to look up some data about the service/device/etc. you are trying to use and see if it would theoretically be possible to do this on the hub in the first place. Good luck!


Here is the the code
I'm about to buy a solar inverter SAJ and i want to read the parameters in it

For me is ok to get that values in any possible methods, HTTP request or Webhooks doesen't matther
But i don't know how to doit

It may be less work, to use the SAJ solar code to interface to MQTT - Then use the existing HE MQTT interfaces, to read/write the specific parameters that your interested in. -

That's how I handle my SMA Sunny Boys, but I already had a MQTT broker on prem, that I was using for other automation interfaces, RatGo, BrulTech GEM, etc.

See: GitHub - paolosabatino/saj-mqtt: Python library and code to read and write registers via MQTT to SAJ H1 and similar power inverters
Of course, YMMV, based on your experience/comfort level with MQTT

1 Like

May I suggest a different and much simpler approach? Spin up a Home Assistant instance, install the Home Assistant automation for your device. Then, on Hubitat, install HADB, which brings Home Assistant devices into Hubitat. HADB is really well done and works well. I use it on several cloud devices for which no Hubitat driver exists.

The best code is code that you don’t have to write, debug, or maintain.


Good Thanks
I will try

Really? it does exist this magic thing?

Yes. You can install it manually or, easier, install on Hubitat through Hubitat Package Manager (“HPM”). I have the RatGDO device (MyQ replacement), Litter Robot device, and SureFlap Pet Door device running on Home Assistant and brought into Hubitat. Works flawlessly. I don’t use Home Assistant dashboards or automations. And, yes, it is magic.

Good idea

OOOK but you need a real HA Hardware

Not really. If your device is cloud or WiFi based, as yours seems to be, just install Home Assistant software on a server or computer or Raspberry Pi you have lying around. No “real” dedicated HA hardware required. Even though I run my HA instance on HA Yellow hardware (no Z-Wave or Zigbee devices on my HA Yellow hardware), HA runs on a wide variety of platforms. If you are considering implementing a solution for your integration that involves MQTT, that will require spinning up an MQTT broker on another piece of hardware (Raspberry Pi or server or computer). Because it’s already going to require another piece of hardware, I was just offering a much simpler solution.

And, again, if you go the HA to HADB to Hubitat path, you won’t have to be writing code because it’s all written, debugged, and maintained.

Choose whatever path makes you feel the most comfortable. There are many ways to do this. But i NEVER said you needed to buy Home Assistant hardware.



1 Like