Page 1 of 1

OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 10:19 am
by Different Computers
I thought I understood the instructions for converting State to Boolean.

But this isn't working. It reports as "false" whether I leave the false value *ELSE* or make it Closed. And I don't get a True if I open the sensor. What am I missing?

Re: OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 10:40 am
by Colorado4Wheeler
onOffState is already a boolean, so the configuration you posted says "If True = Open then Conversion = True Else Conversion = False". Since True never equals "Open" it's going to be false. If you are trying to reverse the states where when onOffState is False then Converted State is True, then you just put false in the first condition and true in the second (I actually use that a lot in my stuff because a lot of plugins reports some state backwards of what is useful to me).

It can be confusing because Indigo gives multiple options for booleans for ease of reading, so even though you SEE Open/Closed, Indigo still sees that as True/False with different names. There are a few of these in Indigo like On/Off is also just another alias for True/False.

So pretend that Open = True and Closed = False and try it like that.

Make sense?

If not then run this code to your log and post it here so I can see what you are seeing:

Code: Select all
dev = indigo.devices[YOURDEVICEID]
indigo.server.log(unicode(dev))

Re: OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 11:11 am
by Different Computers
Ahhhh.

I think I was totally misunderstanding the point of the conversion!

I'm trying to get a status for the sensor to say "Open" instead of "On" and "Closed" instead of "False."

Looks like this plugin doesn't do that.

Re: OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 11:40 am
by Colorado4Wheeler
Different Computers wrote:
I'm trying to get a status for the sensor to say "Open" instead of "On" and "Closed" instead of "False."

It doesn't current convert one value to a string equivalent but honestly that's pretty simple for me to add - and it's a good time too because I'm about to release an update to this plugin in the next few hours. Can you run that code and do a dump of the device so I can see what you are converting just so I know what I'm working with?

The whole point of this plugin is to take interesting things like that and have an easy "go-to" place to get the job done, so suggestions are awesome :).

Re: OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 11:54 am
by Colorado4Wheeler
Download the latest plugin, it's 1.4.3 (soon to be 1.5.0), see if the new conversion for "Boolean to string" does what you want.

Re: OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 12:09 pm
by Different Computers
Colorado4Wheeler wrote:
Download the latest plugin, it's 1.4.3 (soon to be 1.5.0), see if the new conversion for "Boolean to string" does what you want.

Exactly and perfectly!

As perfectly as can be in a separate device. I'm sure you know this has been long asked for. Until v7 comes out this is great.

Re: OnOffState to Open/Closed?

PostPosted: Sun Jun 12, 2016 12:16 pm
by Colorado4Wheeler
Different Computers wrote:
Exactly and perfectly!

Yay! 7.0 may make it obsolete but if so I only wasted 10 minutes of my time :).