We have moved at community.getvera.com

Author Topic: Default handling dor Vera state variables of type boolean  (Read 902 times)

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Default handling dor Vera state variables of type boolean
« on: December 22, 2014, 05:57:37 am »
@guessed: would it make sense to define a default IN transformation for all Vera state variables of type boolean ?
The transformation could consider as inputs: 1, 0, true, false, yes, no and set ON or OFF as output.
As an example, the variable SonosOnline.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Default handling dor Vera state variables of type boolean
« Reply #1 on: December 22, 2014, 01:17:52 pm »
@guessed: would it make sense to define a default IN transformation for all Vera state variables of type boolean ?
The transformation could consider as inputs: 1, 0, true, false, yes, no and set ON or OFF as output.
As an example, the variable SonosOnline.

That could work for Read-only, but Read-write Items need a reversible map.

So far, I've mapped anything Read-only to the states of the Contact Item type, notably OPEN/CLOSED (eg. SecuritySensor1/Tripped).  The Read-Write stuff would likely need to map (reversibly) to the OnOff states of the Switch Item type (eg. SecuritySensor1/Armed)

That said, there are a lot of ServiceId's that I don't default this for at the moment.  When you come across new ones you can just let me know what you think the mapping should look like, we can discuss it, and I'll add it.

Here are the current defaults, described by their ServiceId/StateVariable combination.