trigger shows old state names

Posted on
Tue Jan 16, 2018 1:59 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

trigger shows old state names

I have modified states in a device and would like to update a trigger

In the trigger I want to select a "device/state" has changed.

when opening the state sector in action I see old state keys only.. I have changed the state keys(removed GasScore added AirQuality)
"AirQuality" is missing in the trigger window devices/state listing, GasScore is still there

Restarting server, start/stop the device, edit/save the device does not change it .

selecting state="GasScore" (which is removed) the trigger in the trigger home window actually then shows the right device/state "AirQuality" after saving

I guess something needs to be refreshed on the server.

deleting the device and recreating would fix i? but then I loose all the links

Karl
Attachments
Screen Shot 2018-01-16 at 13.53.19.png
Screen Shot 2018-01-16 at 13.53.19.png (5.87 KiB) Viewed 2907 times
Screen Shot 2018-01-16 at 13.29.26.png
Screen Shot 2018-01-16 at 13.29.26.png (183.45 KiB) Viewed 2907 times

Posted on
Tue Jan 16, 2018 3:29 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: trigger shows old state names

If you change the states on a device you need to refresh them, I do this on my deviceStartComm in my plugins to cover me for just that situation:

Code: Select all
dev.stateListOrDisplayStateIdChanged()


This should resolve your issue if I understand it correctly.

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
Tue Jan 16, 2018 5:22 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: trigger shows old state names

Yes that is executed . It is still there.


Sent from my iPhone using Tapatalk

Posted on
Tue Jan 16, 2018 5:28 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: trigger shows old state names

I'd have expected just the dev.stateListOrDisplayStateIdChanged() call to refresh it. Are you positive it was called for the device in question? And a shutdown/restart of both the Indigo Server and Client didn't help?

Image

Posted on
Tue Jan 16, 2018 6:05 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: trigger shows old state names

this is the structure:
1. set flag to init at startup
2.in def deviceStartComm(): if init do the state update
3. in run runConcurrentThread set flag to run to avoid constantly updating the states.

and yes, the server was restarted
Code: Select all
    def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):
        indigo.PluginBase.__init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs)
....
        self.pluginState                = "init"

Code: Select all
    def deviceStartComm(self, dev):
        try:
            if self.pluginState == "init":
                dev.stateListOrDisplayStateIdChanged()  # update  from device.xml info if changed
...

Code: Select all
    def runConcurrentThread(self):
....
        self.pluginState    = "run"
..

Karl

Posted on
Tue Jan 16, 2018 6:12 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: trigger shows old state names

Did you quit the client (after the server shutdown)?

Image

Posted on
Tue Jan 16, 2018 6:47 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: trigger shows old state names

no, but did that too NOW ... and still the same result .. see attached screen shots

Karl
Attachments
Screen Shot 2018-01-16 at 18.47.14.png
Screen Shot 2018-01-16 at 18.47.14.png (42.75 KiB) Viewed 2832 times
Screen Shot 2018-01-16 at 18.46.24.png
Screen Shot 2018-01-16 at 18.46.24.png (58.07 KiB) Viewed 2832 times

Posted on
Tue Jan 16, 2018 6:51 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: trigger shows old state names

Search your entire Devices.xml file for "GasScore". Is it anywhere in there? As the value for a <TriggerLabel> node?

Image

Posted on
Tue Jan 16, 2018 7:09 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: trigger shows old state names

Code: Select all
               
                <State id="AirQuality">
                    <ValueType>number</ValueType>
                    <TriggerLabel>GasScore</TriggerLabel>
                    <ControlPageLabel>GasScore</ControlPageLabel>
                </State>


indigo is always right ..

:oops:

Posted on
Tue Jan 16, 2018 8:36 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: trigger shows old state names

Lol, we’ve all done something similar :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
Wed Jan 17, 2018 6:52 am
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: trigger shows old state names

My personal favorite is when I save a Python script with the name of an internal Python method.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Jan 17, 2018 8:58 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: trigger shows old state names

One of mine is, especially with so many plugins I've written (I've only published maybe 1/2) that I make a change and it doesn't show up even though I restarted the plugin a dozen times - only to realize I've been restarting the wrong plugin or I didn't actually SAVE the file in my Python editor :roll:

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
Wed Jan 17, 2018 11:23 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: trigger shows old state names

Yeah, I just love the "how in the world is this possibly happening?" type of bugs. One advantage we have here is I can search the Indigo source code to help narrow down the scope of the problem. Even with that though I still sometimes end up chasing my tail. :roll:

Image

Posted on
Wed Jan 17, 2018 11:26 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: trigger shows old state names

matt (support) wrote:
"how in the world is this possibly happening?" type of bugs.

I have long term damage to my forehead from banging it on my desk when that happens. After a while I start to get really mad too and talk to myself, my wife will walk in and wonder who I was just cussing at (because I talk to the code and my computer like it was person when I'm like this) and when I don't look up and ignore her entirely she knows I'm coding :P

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
Wed Jan 17, 2018 11:46 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: trigger shows old state names

Some bugs can truly make you question your sanity. :mrgreen:

Image

Who is online

Users browsing this forum: No registered users and 2 guests