Getting a state's UI value back to default

Posted on
Fri Feb 23, 2018 4:47 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Getting a state's UI value back to default

So in messing with a plugin I accidentally change the UI value of an Insteon relay to "closed" and it's stuck there. I did the following script to see if it would go back to normal and it sets it to 'off' but it doesn't toggle with power:

Code: Select all
indigo.devices[61003944].updateStateOnServer ("onOffState", False, uiValue="off")


Is there a way I can clear that UI state and tell it to just be nice and play well with others again?

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
Fri Feb 23, 2018 6:12 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting a state's UI value back to default

Just toggle it in the UI - right? Maybe I'm not understanding the issue...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Feb 23, 2018 6:22 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Getting a state's UI value back to default

jay (support) wrote:
Just toggle it in the UI - right? Maybe I'm not understanding the issue...

I can do that, but I accidentally changed a device that is not part of my plugin, it's just an Insteon device in my system, now it no longer updates it's state automatically as it's not tied to my plugin I don't have control and would have to now write some trigger that changes the value based on state changes.

So think about it this way, you create brand new Insteon device, when you toggle that device on and off the state display shows "on" or "off". Well now imagine that I accidentally used that ID in a script and gave it a UI state of "hello", it will no longer say "on" or "off" anymore, I now have to set it myself each time and I want to fix my oops and set it back to default.

Does that make sense?

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
Sat Feb 24, 2018 5:00 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: Getting a state's UI value back to default

Set it to an empty string and it will clear out the uiValue override:
Code: Select all
indigo.devices[61003944].updateStateOnServer ("onOffState", False, uiValue="")

Image

Posted on
Sat Feb 24, 2018 5:21 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Getting a state's UI value back to default

Two life savers in one day, you're on a roll. Thank you!

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 Feb 25, 2018 11:07 am
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting a state's UI value back to default

Hmmm - seems like that's a bug. If the script/plugin doesn't own the device, I thought it wasn't possible for it to change the state (and thereby the UI value)...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Feb 25, 2018 11:13 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Getting a state's UI value back to default

jay (support) wrote:
Hmmm - seems like that's a bug. If the script/plugin doesn't own the device, I thought it wasn't possible for it to change the state (and thereby the UI value)...


That's exactly what I thought too, thus was totally shocked when it happened.

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 Feb 25, 2018 11:57 am
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: Getting a state's UI value back to default

I'll chime in here and say that is what I thought as well. Does anyone around here know how this thingie works? :mrgreen:

Image

Posted on
Sun Feb 25, 2018 12:02 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Getting a state's UI value back to default

matt (support) wrote:
I'll chime in here and say that is what I thought as well. Does anyone around here know how this thingie works?

HAHAHAHA!

I can say this, it's not unique to my plugin because when I ran your script to just clear the UI I did it from an action group script and not my plugin (where I originally broke it). I know I cannot update plugin props but apparently the State and UI are fair game :shock: :lol:

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 Feb 25, 2018 3:22 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: Getting a state's UI value back to default

Apparently updating states is private (only allowed by the device owner), but there is an exception for X10 and INSTEON devices. I don't recall the exact reasoning behind that but I believe there were some scripts/plugins that needed the ability to modify states for those devices so we allowed it. At least that is the story I'm going to stick with.

Image

Posted on
Sun Feb 25, 2018 3:50 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Getting a state's UI value back to default

I buy it :wink:

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 3 guests