OnOffState to Open/Closed?

User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

OnOffState to Open/Closed?

Post 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?
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 3533 times
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: OnOffState to Open/Closed?

Post 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))
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
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: OnOffState to Open/Closed?

Post 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.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: OnOffState to Open/Closed?

Post 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 :).
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
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: OnOffState to Open/Closed?

Post 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.
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
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: OnOffState to Open/Closed?

Post 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.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: OnOffState to Open/Closed?

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

Return to “Device Extensions Plugin”