ratgdo / mqtt-ratgdo

ratgdo via mqtt
GNU General Public License v2.0
76 stars 16 forks source link

Add selected control protocol to HA discovery message payload #75

Open Goose66 opened 5 months ago

Goose66 commented 5 months ago

Could the configured control mode be added to the discovery payload? Perhaps something like:

{
  "~": "ratgdo-41533",
  "name": "Door",
...
  "device": {
    "name": "ratgdo-41533",
    "identifiers": "ratgdo-41533_C8:C9:A3:18:F1:04",
    "manufacturer": "Paul Wieland",
    "model": "ratgdo",
    "sw_version": "2.57",
    "configuration_url": "http://192.168.1.109/",
    "control_protocol": "drycontact"  # <---- add this or "secplus1" or "secplus2" etc. 
  }
}

This would help my UDI Polyglot plugin better understand the capabilities of the ratgdo device with the connected GDO. I do appreciate the change already in place to only publish the light discovery messages if not "drycontact" mode.

Goose66 commented 5 months ago

I suppose if adding a new key would upset HomeAssistant for some reason, it could always be added to the "model" value, e.g.: "model": "ratgdo-drycontact"

Goose66 commented 5 months ago

Alternatively, perhaps a REST interface at the configuration_url I could read to get the control protocol, if that is easier (or already exists).