#1152 Reading Str points as integers and not text

Ryan Cruz Wed 12 Mar

Is there a way to read a point of Kind = Str where the returned value is an integer and not a string? I saw a forum post from 2012 where it was decided to do the string output. https://project-haystack.org/forum/topic/52

However reading the point value and doing anything meaningful with it, you need to handle an unknown amount of strings. Where simply getting the the integer value like a BACnet Multi State point would be useful. This is my first post in form forum, so maybe my ask is unclear, but I'm looking to see if reading the integer value of a Str point is currently possible via the Haystack HTTP API? How would one lobby for a feature to be added to allow the read request to specify the return type? e.g. return the value as an integer, not a string.

Brian Frank Wed 12 Mar

Enums are always string keys. Obviously sometimes they might also have an integer encoding too, but not always. So currently everything is built around an string key

you need to handle an unknown amount of strings. Where simply getting the the integer value like a BACnet Multi State point would be useful

Can you explain this more and your use case?

Ryan Cruz Tue 18 Mar

Our use case is to collect trends for mapping all of the possibilities of string values into an integer so we can understand which state a point is in. The values control how we interpret the raw data and know which mode a point is in. For each point we plot the change of value over time. If we map the string enumerations to integer values in our system, the mapping breaks when the enum string value changes in Niagara (e.g. if someone renamed "dehum" to "dehumidification").

With that in mind, is it plausible to update the HTTP API operations to support reading/watching enumerated values to optionally include the backing integer value when defined?

Login or Signup to reply.