rudyberends / homebridge-loxone-proxy

Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit
Apache License 2.0
12 stars 6 forks source link

InfoOnlyAnalog mapping based on format. #103

Open TimWuyts opened 1 month ago

TimWuyts commented 1 month ago

Thank you for this great homebridge plugin! I'm experimenting with it right now & really like it so far.

I'm thinking about adjusting the mapping off the InfoOnlyAnalog controls based on their given format. Eg: For temperature sensors, the format I'm using in my installation is always "%.1f°". Would you allow such a PR or should I maintain my own fork for this change?

rudyberends commented 1 month ago

No problem. I am happy to allow the pr. The reason I created this plug-in is that the Loxone-Connect one had many forks, All with their own specific feature set. I would like to prevent this with this plugin so all PRs are welcome.

I am also willing to implement the feature myself, if you can give me some more information on how you would like this to be implemented.

TimWuyts commented 1 month ago
Scherm­afbeelding 2024-10-21 om 14 19 01

The Loxone structure file always contains a "details" -> "format" property for inputs of type "InfoOnlyAnalog". Depending on the specified format, you could map the sensor type within homebridge. Eg: "%.1f°" corresponds to a temperature sensor.

In this way you could extend the existing mappings (based upon the "name" property) or create a new mapping for the "format" property.

rudyberends commented 1 month ago

I have implemented this in the latest beta version. This is the change: https://github.com/rudyberends/homebridge-loxone-proxy/commit/86245b33c7674cf3071ce8cb5499512e16b35cc9

Will this work for you?