willglynn / taptap

An implementation of the Tigo TAP protocol
MIT License
46 stars 12 forks source link

Influxdb or MQTT #4

Open prato0815 opened 5 months ago

prato0815 commented 5 months ago

Hello Will Glynn Thank you for this great project. I now get my data from the Tigo system. The integration with Openhab via Influxdb or MQTT would be great. I hope you expand your project to include one of these options.

litinoveweedle commented 5 months ago

You see @willglynn? ;-) That was the thing I was talking about. One user wants HomeAssistant integration, other pure MQTT, third OpenHab, etc. (@prato0815 there is nothing wrong about your feature request, don't worry I jam just taking it as an argument for another discussion.) As an IT architect I prefer layered approach to things, each layer segregated and performing only one function, but implementing it in the open and versatile (*NIX) way. So having TapTap doing exactly what it can (and no else application can) = to tap the modules communication.

And then anyone can decide and take taptap and integrate in into MQTT bridge, HA native integration or addon, OpenHab or really anything usable. So if you would like to fulfill this and/or other similar feature request, I beg you please do it as another separate project built on top of the current generic taptap features. Why? As you will otherwise need to create jack-of-all-trade application, which will be very complex and not versatile at all - at least not for the use cases you will not integrate yourself. Honestly I would be much more happy if you could focus to the maintenance of the TapTap itself, as I can imagine that Tigo is right now planning to close this potentially growing loophole to their greedy corporate pocket.

And sorry for my rambling and steeling the topic. Mea Culpa.

willglynn commented 5 months ago

@prato0815 This makes sense. I plan to add such connectivity to taptap.

@litinoveweedle taptap is both an executable and a library. I built it this way specifically to prevent in-tree integrations from strangling the project. taptap::observer contains all high-level functions, and it specifically emits a stream of taptap::observer::Events. These events can consumed from another Rust crate right now, or they could be output as JSON and imported into anything can read JSON using the taptap CLI. (There's even JSON Schema support!) The separation of concerns you seek already exists. Adding a feature which consumes these events and outputs them for InfluxDB does not harm anyone.

litinoveweedle commented 5 months ago

@willglynn perfect, thank you for clearing my concerns.

litinoveweedle commented 2 months ago

@prato0815 Hello, sorry for late reply, but I can now announce my small project - taptap to MQTT bridge. It is primarily used for Home Assistant, as it already provide HA MQTT discovery for all entities, but it could be used with manual configuration for other projects as well.

As my knowledge of Rust == 0, and there are no usable binding to Python, I had to enclose taptap binary and I am reading from it via stdout. Current version is early alpha, having still stability and functional issues, but I would welcome some users inputs, although I can not guarantee if I will use them. ;-)

litinoveweedle commented 1 month ago

In addition to the standalone taptap-MQTT bridge I took the opportunity to package it as an Home Assistant addon so now it shall be simple to integrate taptap into HA. ;-)