Page 1 of 1

minor issue

PostPosted: Thu Dec 08, 2016 2:08 pm
by berkinet
homebridge-indigo does not like the slash (/) character in device names. The json parser throws a SyntaxError and the device or action is ignored. This is a minor problem and appears to be due to parser limitations that require a "/" to be escaped as "\\/" I'm not sure this is even worth fixing, but it is probably worth documenting.

Thanks for your work on this interface.

Re: minor issue

PostPosted: Thu Dec 08, 2016 2:17 pm
by Colorado4Wheeler
It also has a problem if your first character is a space. I've just ignored it because it's not a big deal, but since the topic came up of "things not to call your HB devices..." :o .

Berkinet, you can use an alias or wrapper in HBB to work around that.

Re: minor issue

PostPosted: Thu Dec 08, 2016 3:00 pm
by berkinet
Colorado4Wheeler wrote:
...you can use an alias or wrapper in HBB to work around that.

Or, you can just change the device/action names :wink:

Re: minor issue

PostPosted: Thu Dec 08, 2016 3:23 pm
by Colorado4Wheeler
Yes, but sometimes I want that odd name in Indigo... :wink:

Re: minor issue

PostPosted: Thu Dec 08, 2016 4:28 pm
by jay (support)
berkinet wrote:
homebridge-indigo does not like the slash (/) character in device names.


How does Siri recognize a device name with a slash in it?

Re: minor issue

PostPosted: Thu Dec 08, 2016 4:43 pm
by berkinet
jay (support) wrote:
...How does Siri recognize a device name with a slash in it?

That's a question that, like "Do I look fat to you?" should never be answered.

However, "siri" (actually "voice to text") does understand several punctuation characters: newline, period, comma, question mark, etc., AND sometimes even "slash" In my testing "she" got the slash right about 1/2 the time. Things like a-slash-b seemed to work fairly frequently and anyway, the "/" might, in some cases, be useful in the GUI.

In this case, it is clear that the first problem was the json parser. However, it is a moot point since the "/" is not allowed in Accessory names anyway:
From https://developer.apple.com/library/con ... abase.html

    Rules for Naming Objects

    The names of HomeKit objects—such as home, room, and zone objects—are recognized by Siri where indicated in this document. The following rules apply to setting names of HomeKit objects:

      Names must be unique within their namespace.
      The names of homes belonging to a user are in one namespace.
      A home object and its containing objects are in another namespace.
      A name can contain only alphanumeric, space, and apostrophe characters.
      A name must start and end with an alphabetic or numeric character.
      Space and apostrophe characters are ignored in comparisons (for example, home1 and home 1 are the same).
      A name is not case-sensitive.

Re: minor issue

PostPosted: Thu Dec 08, 2016 7:17 pm
by jay (support)
berkinet wrote:
it is a moot point since the "/" is not allowed in Accessory names anyway


While not specifically because it's disallowed, that was my point in practice... ;)