jvmahon / Homebridge-HomeSeer4

Homebridge Plugin for HomeSeer 3 and 4
29 stars 8 forks source link

Options for Device Naming #104

Closed mwolter805 closed 4 years ago

mwolter805 commented 4 years ago

Wondering if more flexibility could be added with regard to device naming?

Devices in my homeseer follow a naming convention that greatly helps when selecting a device within homeseer native functions such as Events and within other Homeseer Plugins. For example, 'Bedroom Ceiling Light - Dimmer' with the room being 'Bedroom'.

Your plugin then names the devices '{homeseer room} {homeseer device name}' which makes the homebridge device name 'Bedroom Bedroom Ceiling Light - Dimmer'. Since this name is not ideal for the Home app or Siri, I then have to manually edit the device name either in the 'accessories' portion of the config or within the Home app itself which can be very time consuming to create and update if the device name changes.

Is it possible to add a couple of device setting in the config that overrides the default naming?

For instance, it would be helpful to have the option to remove {homeseer room} from the automatically generated name.

It would also be helpful to have the option for a user to input a regex expression to filter the naming of the device. For my example I could enter the regex expression ^.*(?=(\ -)) to match everything upto and excluding the 'space dash'. This could make the automatic naming much more powerful and manually editing the name would be unnecessary as long as naming conventions were used in Homeseer.

It would also be helpful if these naming options could be entered into the platform section to set a global default or in the accessories section for the particular device to override the global default.

These two changes would not only help with the initial configuration of your plugin but also changes to the device name would automatically pass through homebridge without manually editing the config.

Thanks!

jvmahon commented 4 years ago

Sorry. I won't have time to implement this. I'm switching over most of my devices to Hubitat so I'm just doing basic maintenance / bug fixes on this code right now.

Device names are set in the "HomeSeerUtilities.js" file at about line 168. If you want to create a branch and give implementing this a try, please do so and then submit a pull request.