ebaauw / homebridge-p1

Homebridge plugin for DSMR end-consumer (P1) interface
Apache License 2.0
53 stars 11 forks source link

Exclusive connection and the use of a splitter #34

Closed tomsteenbakkers closed 3 years ago

tomsteenbakkers commented 3 years ago

Hi Erik,

Small questions: I have p1 running on the RaspberryPi and it's working fine. I see the graphs in the Eve app. The only thing is that interacting with these graphs is very limited in the Eve app.

I have installed https://github.com/psy0rz/p1_dsmr_to_influxdb. This python script gets the data from the p1 port and insert them in an Influx DB so I can use Grafana to make nice dashboard to interact with the data.

As you mentioned your plugin keeps a permanent, exclusive connection to the serial port which means that the Python script can not access the P1 port when Homebridge is running. If I stop Homebridge the script is filling up the Influx DB.

It is an option that, besides sending the data to the Eve app, you also can send the data to an Influx Database?

If that is not an option do you think that this splitter kan work?

https://www.iungo.nl/nl/bestellen/i/453-p1-poort-splitter

Thanks for you response in advance.

ebaauw commented 3 years ago

Obviously, Homebridge P1 cannot provide a P1 serial port to other P1 clients, but It does provide a web server with web sockets that relay the raw telegrams in text, the raw telegrams as JSON and the telegrams as cooked JSON (as consumed by Homebridge P1). Set wsPort in config.json to specify the port for the server and enable it. See #5. See https://github.com/ebaauw/homebridge-p1/blob/master/test/ctest.js as an example of how to connect to these web sockets from Javascript running on NodeJS.

Personally I have no experience with splitter cables. A passive cable might not work, but I have one report of an active cable working, see https://github.com/ebaauw/homebridge-p1/issues/5#issuecomment-587430053.

tomsteenbakkers commented 3 years ago

Hi Eric,

Today I installed the splitter and everything is working!

I used the following hardware:

One USB kabel is connected to a RaspberryPi running HomeBridge and the P1 plugin. The other USB kabel is connected to a RaspBerryPi running a Python script which gets the data (via the splitter) from the Pi port and stores the data in a Influx database from which I create a Grafana dashboard.

The Eve app reports the same data as the Grafana dashboard.

The Python3 scipts: https://github.com/psy0rz/p1_dsmr_to_influxdb

ebaauw commented 3 years ago

Thanks for reporting back!