HASS.Agent icon indicating copy to clipboard operation
HASS.Agent copied to clipboard

Bug: HA rejects devicenames with a whitespace

Open ipodmusicman opened this issue 3 years ago • 1 comments

When I installed HASSAgent, I set my device name to a single word (Desktop). After setting up my sensors and commands, I could see them appear in Home Assistant. I then decided to rename my device name to contain two words separated by a space (Desktop computer). My device with its entities did not re-appear in Home Assistant. There was no indication as to what was wrong.

Since it worked with the old device name, I renamed it to using one word DeviceComputer and voila, my device appeared in Home Assistant.

A suggested fix would be that when entities are published, to search-replace spaces within the device name with an underscore when creating the device entities. Also make sure to handle any special characters - not sure how HA treats special characters in entity IDs.

ipodmusicman avatar Jul 09 '22 06:07 ipodmusicman

Hey @ipodmusicman,

Thanks for taking the time to report this! I did add those devicename 'sanitation' checks, but I forgot the whitespace and that has been causing a lot of trouble :( I'll definitely add it in the next beta.

Glad you got it sorted out for yourself!

LAB02-Admin avatar Jul 09 '22 08:07 LAB02-Admin

Fixed in the latest beta

LAB02-Admin avatar Aug 14 '22 07:08 LAB02-Admin