Read serial data in OH2 sent over wifi by a local device

I have installed an inverter (local IP:, “local station” mode) factory pre-programmed to send data (numbers + info text) over wifi to a remote location (, via port: 80 // I can change this address and port anyway) via my local router. These data arrived succesfully to that remote destination but I cannot have any control over that database to read/sync etc.

So I want to gather these data too in my local OH2 (RPI). Could you help me with some steps about how to approach that project?

It might work, but could be tricky. At first you need to figure out what sort of request that gets sent and to what path. Since it sends to port 80 it’s most probably http, but that’s all we know.

A possible approach would be to install nginx (or another http server), make your inverter send data to it and just check the access log. There you should be able to see the method (GET, POST or PUT) and path.

If you can get this far we can determine what more steps that need taken.

The TCP binding will probably be useful.

I’m trying with HTTP biding now.

# 3 // get RS232 Serial data from inverters
Number Inverter01Event { http="<[inverter01:1000:($.voltage.[0])]" }

No able to read anything.

The http binding is just for sending requests, it cannot listen for requests from other devices. The TCP binding that @rossko57 suggested can both act as client and server, so it can listen for incoming connections.

OK, I’ve installed TCP.
I’ve create

ON= *S,0,2,01; 
OFF = *C,0,2,01; 

Than edit my.items file:

Number InverterEvent tcp=">[ON:'MAP(')], >[OFF:'MAP(']"```

I cannot see any piece of information after add this in my.sitemap file:

Frame label=""{
		Text item=InverterEvent label="Inverter: [%s]" labelcolor=[""]


You have configured the item to send data TO your inverter, not to listen for data FROM your inverter, which is what you wanted, no? And what is the map transformation supposed to represent?

Slow down. Map? Just find out what your mystery data is first. Do you even know if it is TCP yet?

What about point the inverter to your PC and use Wireshark to see what is beeing sent :slight_smile:

Here is one way of doing such things that might inspire you.

1 Like