OnOffState to Open/Closed?

Posted on
Sun Jun 12, 2016 10:19 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

OnOffState to Open/Closed?

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?
Attachments
Screen Shot 2016-06-12 at 12.08.46 PM.png
Screen Shot 2016-06-12 at 12.08.46 PM.png (67.94 KiB) Viewed 2655 times

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sun Jun 12, 2016 10:40 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: OnOffState to Open/Closed?

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))

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Jun 12, 2016 11:11 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: OnOffState to Open/Closed?

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.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sun Jun 12, 2016 11:40 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: OnOffState to Open/Closed?

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 :).

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Jun 12, 2016 11:54 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: OnOffState to Open/Closed?

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.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Jun 12, 2016 12:09 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: OnOffState to Open/Closed?

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.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sun Jun 12, 2016 12:16 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: OnOffState to Open/Closed?

Different Computers wrote:
Exactly and perfectly!

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

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest