That’s really helpful! Does that apply to prior versions? Let me be specific here, the HASPone project blasts out several discovery messages on startup, one for the device and then one for each entity that can be controlled. Here is an example of the existing discovery message for the backlight on a device named devhasp
:
{
"name": "devhasp backlight",
"command_topic": "hasp/devhasp/light/switch",
"state_topic": "hasp/devhasp/light/state",
"brightness_state_topic": "hasp/devhasp/brightness/state",
"brightness_command_topic": "hasp/devhasp/brightness/set",
"availability_topic": "hasp/devhasp/status",
"brightness_scale": 100,
"unique_id": "devhasp-8cce1234abcd-backlight",
"payload_on": "ON",
"payload_off": "OFF",
"payload_available": "ON",
"payload_not_available": "OFF",
"device": {
"identifiers": [
"devhasp-8cce1234abcd"
],
"name": "devhasp",
"manufacturer": "HASwitchPlate",
"model": "HASPone v1.0.0",
"sw_version": 1.05
}
}
Today, this creates an entity named “light.devhasp_backlight”. That entity is referred to by name in associated blueprints etc, so any changes to that entity name is going to break the stack. Yeah, I get that this shouldn’t be the case but limitations on blueprint selectors and template functions forced the issue at the time this was developed. It has worked fine for years.
My understanding of the new HA requirements suggest I should change the line "name": "devhasp backlight"
to "name": "backlight"
, which should create the entity light.devhasp_backlight
just as before.
However, in my limited testing, I think this also means that prior releases will create that device as light.backlight
, and as a result, most of the blueprints won’t work.
Am I understanding this correctly?
edit: reading further on object_id
, it turns out this directive goes back a ways and probably can solve this for me. Thanks @petro !