New(?) error on startup...

Posted on
Wed Apr 28, 2021 10:49 am
jay (support) offline
Site Admin
User avatar
Posts: 16718
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New(?) error on startup...

kw123 wrote:
Code: Select all
    def startup(self):
        self.sleep(60.)


Gut reaction: this probably isn't a good idea. The Indigo Server expects responses from plugins quickly and has a variety of things that it calls back in to a plugin for. If a plugin is sleeping in the middle of its startup sequence, then anything the server may try to contact the plugin about would likely timeout (deviceUpdated calls when a plugin subscribes comes to mind though that might be solved by clever ordering).

I haven't actually tested, so I can't be sure, but on the surface it seems like a bad idea.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Apr 28, 2021 10:50 am
kw123 offline
User avatar
Posts: 7640
Joined: May 12, 2013
Location: Dallas, TX

Re: New(?) error on startup...

I tried 200000 secs and no complains for > 5 minutes


Sent from my iPhone using Tapatalk

Posted on
Wed Apr 28, 2021 10:56 am
dclonts offline
Posts: 45
Joined: Nov 05, 2006

Re: New(?) error on startup...

So that worked for me using a delayed startup action.

But still problem with KPL Lets. I have a plugin for my pool, and it manifests as a bunch of switches. When indigo starts up, I do a KPL Update LEDS in Cynical Behaviors plugin. Have a bunch of Keypad Button Device controls linked to the actual Hayward Pool switch/dimmer devices.

I would think that the Update LEDS would look at the device state of the Hayward Pool switch devices and update the KPL leds, but does not seem to happen. Need to do at startup because the device states may not match the led states.

David Clonts

Posted on
Wed Apr 28, 2021 10:56 am
norcoscia offline
User avatar
Posts: 967
Joined: Sep 09, 2015

Re: New(?) error on startup...

Thanks so much Karl - really nice of you to help me out and spend so much time creating and sharing all of your plug-ins!!!!!!!

Jay -- thanks for the warning - I know this is not a problem that will cause anything to not work but I like to watch the log when I reboot Indigo - super hard for my old eyes to follow with a ton of red warning interspersed with startup messages.

This (and only this) plugin has been doing this to me since back to version 6 days - just wanted the pain in my neck to end so going to try it unless you have a recommendation for something less risky

PS. later today I will run with scissors :-)

_______
Norm

Posted on
Wed Apr 28, 2021 11:05 am
kw123 offline
User avatar
Posts: 7640
Joined: May 12, 2013
Location: Dallas, TX

New(?) error on startup...

here the code in can behavior plugin:

change from:
Code: Select all
.....
#
# The plugin.
#
from cyin.plug import entry, CONCURRENT

class Plugin(cyin.asynplugin.Plugin):

   loosedevices = cyin.PluginPreference(type=bool, default=False)


   #
   # Listen for incoming INSTEON commands and send them to our devices.
   #
   def startup(self):
      indigo.insteon.subscribeToIncoming()
   
   @entry(CONCURRENT)
   def insteonCommandReceived(self, cmd):
      if cmd.cmdSuccess:
         for watcher in LeakWatch.all():
            watcher._event(cmd)
         for kpl in ButtonBehavior.all():
            kpl._kpl_event(cmd)
....

to
Code: Select all
.....
#
# The plugin.
#
from cyin.plug import entry, CONCURRENT

class Plugin(cyin.asynplugin.Plugin):

   loosedevices = cyin.PluginPreference(type=bool, default=False)


   #
   # Listen for incoming INSTEON commands and send them to our devices.
   #
   def startup(self):
      self.sleep(30)
      indigo.insteon.subscribeToIncoming()
   
   @entry(CONCURRENT)
   def insteonCommandReceived(self, cmd):
      if cmd.cmdSuccess:
         for watcher in LeakWatch.all():
            watcher._event(cmd)
         for kpl in ButtonBehavior.all():
            kpl._kpl_event(cmd)
....

I put 30 secs there, that should be plenty for the rest to startup

Karl
Last edited by kw123 on Wed Apr 28, 2021 7:36 pm, edited 1 time in total.

Posted on
Wed Apr 28, 2021 11:17 am
norcoscia offline
User avatar
Posts: 967
Joined: Sep 09, 2015

Re: New(?) error on startup...

Tried the new one (with 30 seconds) - seem to work great - thanks again Karl!!!!!!!!!!

_______
Norm

Posted on
Wed Apr 28, 2021 11:20 am
jay (support) offline
Site Admin
User avatar
Posts: 16718
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New(?) error on startup...

kw123 wrote:
I tried 200000 secs and no complains for > 5 minutes


Doesn't mean that every case is covered... :wink:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Apr 28, 2021 7:37 pm
kw123 offline
User avatar
Posts: 7640
Joined: May 12, 2013
Location: Dallas, TX

Re: New(?) error on startup...

Yes.
But it is a simple test that takes 2 minutes to see if it works.


Sent from my iPhone using Tapatalk

Posted on
Thu Apr 29, 2021 9:55 am
jay (support) offline
Site Admin
User avatar
Posts: 16718
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New(?) error on startup...

A 2 minute test is NOT A THOROUGH TEST for a commercial product.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 4 guests

cron