Replies: 1 comment 4 replies
-
I had always assumed that the GUI in HA was an easier place to make these changes. If you want to be able to define and control all of this from yaml this seems like a reasonable approach. When coding this please include as many tests as possible just in case something breaks far off in the future and you are around. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I get deeper into using MQTT Discovery for my devices, I find that I'd like to be able to 'inject' device-level details into the discovery configuration. For example, HA supports setting the
icon
, and setting asuggested area
, among other attributes.I don't think it would be practical to try to add support for these in a
discovery_class
(via templating) because if the user doesn't provide a value the config object would end up with an empty attribute.This can be done by creating a discovery_class for each device, but that's a large amount of work and it also means that changes to the base discovery classes in newer versions of insteon-mqtt would have to be merged by hand into those customized versions.
Instead, I think a 'merging' strategy, as used already elsewhere, might make sense.
Proposal
discovery_entities
list so that they can be referred to from device configuration. This would be especially important for keypad_linc which generates a large number of entities. Example ofswitch
:discovery_details
would replace identical keys in the discovery_class (with special handling forconfig
since it is an 'embedded' object) before templating happens. Any new keys provided would be added in their respective locations. The 'device' section would be used to modify the details provided by thedevice_info_template
which apply to all entities for that device.I can envision other 'features' of this as well, such as suppressing default entities (so a 6-button KPL won't generate entities for buttons 2, 7, and 8). My goal here is to provide the maximum amount of detail through MQTT Discovery, and avoid having to override/change details in HA itself after the devices/entities have been discovered by the integration (which means that if they need to be removed and rediscovered the details would not be lost).
All feedback very welcome... and for avoidance of doubt, I'm happy to implement this.
Beta Was this translation helpful? Give feedback.
All reactions