How can I import data from a WebSocket server into Home Assistant?

I’m trying to integrate my w-hi inverter into Home Assistant, but there are no native integrations available. The only method I’ve found is to send a WebSocket request to the inverter portal and parse the returned JSON. I managed to replicate the request with Postman, but I can’t figure out how to send the WebSocket request from Home Assistant. All the guides only explain how to connect to Home Assistant, but not how to import data into Home Assistant from an external service.

Hi Elia, have you found any solution?

I think pyscripts + websockets 12.0 documentation can help, but it will require some coding.

No, I’m sorry. I bypassed the issue by directly integrating with the inverter using Modbus. If you have the same Inverter I can share the config. The solar integration is now working as a charm