Integrate DSEWebnet websocket as sensors and control for my home diesel generator

Hello,

I am a new to developing in Home Assistant, and I never done any custom integrations before.
I live in a remote area where constantly here I have energy shortages due a tree falling on the energy poles, and sometimes it takes very long to get fixed, so I brought a diesel generator, which came with a Deep Sea Electronics PLC connected to DSEWebNet Gateway(DSE890 MKII) , that is connected to the internet with the DSEWebnet.

I researched and found that there is no DSEWebNet integration for HASS, so as I am a programmer, I guess I should build one myself.

I was studying the web interface from DSEWebNet, and found out it uses websocket to read and write into the PLC of the generator.
I already can use insomnia to fully read and write what I want from the generator, its pretty simple as crafting a JSON with the codes I learn from messing around on the interface.

Basically I send a JSON requesting what information I would like to be streamed to me, and when I want to control the operation of the generator I send another JSON with the operation I want (Basically just Off, Auto, On). I could go into the details of how all this data can be crafted but I guess thats not the point.

My question would be: how do I create a custom integration that uses websocket, where at start it sends a json and starts updating sensors I define, and also to create controls which will send the corresponding json command for it to operate?

What would help a lot is another integrations that also use wss in a similar manner, or what steps should I take to get this working.
I haven’t started any coding besides scraping the webapi, so where do I start?

In HASS docs I only found websockets for interacting with the UI or with HASS, but that’s not what I want, I want an integration that uses websocket to fetch sensors and send controls.
I found this similar topic Web socket Sensor but there was no solution for it.

Thanks for looking into this. I also have a generator in Costa Rica with DSEwebNet and would be interested in following your progress.

I had some progress, I was able to send commands directly to DSEWebnet service, however I need to be online.

I used a Insomnia to read the socket that is used on DSEWebnet, and decoded what each thing do.

It should be possible to create an addon that does that .

Awesome. I haven’t been able to make any progress… Would be nice. I doubt the user population with DSEweb is very large, for a developer. But, maybe one day!

The DSE890 MKII is an Ethernet/4G gateway device that enables compatible DSE controllers to be monitored remotely via DSEWebNet® software or third-party MQTT brokers.

I have a generator with a DSE controller but don’t have the DSE890 MKII yet.
I wonder what could be done over MQTT.

Hi Ricardo, I’m developing a tool for a DSEWebnet alternative, I’ve sent a email about this integration, hope I could talk to you and share any knowledge

Any Luck yet? I have a need for this too

@3esmit Hi. I just discovered the same device on my generator. Did you end with some kind of solution ?

Thanks

V.