sfudeus / homematic_exporter

Prometheus exporter for homematic ccu3
Apache License 2.0
23 stars 17 forks source link

Support for non ip devices #10

Closed NilsGriebner closed 3 years ago

NilsGriebner commented 3 years ago

Hi,

I'd like to provide a PR which adds support for HM-CC-RT-DN device. This isn't a HomematicIP device, so the process to gather device stats is a bit different. To fetch those, the exporter needs to talk to a different XML-RPC service which is listening by default on port 2001 of the ccu.

My first question is, would it be OK for you to add support for non IP devices to your exporter?

I assume (haven't tested it yet, because I don't own more devices) your exporter would be able to support further non IP devices by default, without changing the current gathering logic. This would be a great improvement in my opinion :)

In case you are fine with a PR, how would you integrate this feature into your code? I'm struggling finding a suitable, backwards compatible solution, which doesn't break the current command-line arguments.

sfudeus commented 3 years ago

Hi Nils,

generally I'd be open for such an addition, it depends a bit on the size of the changes. Is it just an additional xmlrpc service which needs to be talked to? Does it have a (relevant) different interface? Did you try to run the exporter against port 2001 (using --ccu_port) to see what happens? What would be the output of --dump_devices against port 2001? (It is empty on my CCU3, since I do not have any BidCos-RF devices).

Regarding CLI changes - would you expect/need support for both ports in the same exporter run? You could run 2 instances (or just scrape the single exporter twice with different arguments). What other CLI changes would you foresee?

NilsGriebner commented 3 years ago

Thanks for your quick reply. It looks like it's only another xmlrpc service, which behaves exactly like the current one on port 2010. I ran the exporter with --ccu_port and was able to detect my device without changing the code (had to add it to supported devices of course).

Haven't thought about running two instances of the exporter with different configurations. That's an awesome idea which would work for me without changing the code :)

I'll give it a shot and close this if it works like expected. Thanks :)

sfudeus commented 3 years ago

Would be great if it just works for you, good to know. I'd then add that as a hint to the readme.

NilsGriebner commented 3 years ago

Works like expected with my HM-CC-RT-DN device :) Closing this, thanks for your time!