Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Sensor Naming Convention #48

Closed
aFrankLion opened this issue Feb 22, 2018 · 7 comments
Closed

Sensor Naming Convention #48

aFrankLion opened this issue Feb 22, 2018 · 7 comments

Comments

@aFrankLion
Copy link

The sensor naming convention in parse_sml() in the file /custom_components/sensor/hue.py works well for the default naming convention of Hue sensors (e.g., Office sensor, Living room sensor) by inserting "motion" into the penultimate position in the name, e.g.:

  • "Office sensor" -> "Office motion sensor"
  • "Living room sensor" -> "Living room motion sensor"

However, user-defined sensor names can lead to inconsistent and awkward entity_id's in Home Assistant. For example, I had Hue sensors with the following custom names:

  • "Living room 1"
  • "Living room 2"
  • "Office"
  • "Dining room"

These Hue sensor names led to following entity_id's with the current Hue-sensors-HASS naming convention:

  • "Living room motion 1"
  • "Living room motion 2"
  • "Motion office"
  • "Dining motion room"

The simplest solution may be just to recommend in README.md to use the default Hue naming convention for sensors. A second possible approach is to drop the insertion of "motion" into the Hue sensor name. A third possible approach could involve parsing the current sensor names and cleverly naming them (e.g., does the name contain "sensor" or "motion" already, if so..), though this would be difficult to define to cover all possible names well.

@robmarkcole
Copy link
Owner

HI @aFrankLion thanks for your suggestion, I've updated the README. I will leave this 'issue' open so that others can make suggestions on the naming convention if they have ideas. My own thought is just to append 'hue' to the start of the sensor names, so you would get sensor.hue_Living_room_2 for example.
Cheers

@jimbob1001
Copy link
Contributor

Perhaps the entity registry be utilised to allow renaming the sensor in homeassistant?

@robmarkcole
Copy link
Owner

@aFrankLion I think your suggestion that motion is dropped from naming is a good one, and that the entity registry should be the way to rename sensors (never used that feature myself)

@WhistleMaster
Copy link

I had the same issue with a sensor named "Dining room" changed to "Dining motion room".

@yottatsa
Copy link
Contributor

Depends on #115

@LordSata
Copy link

Can i ask if the issue is still open? I have the same problem.... But i read too late of this issue.

@robmarkcole
Copy link
Owner

Stale

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants