Page 2 of 3

Re: Room-O-Matic Contributed

PostPosted: Sat Jan 23, 2016 10:29 pm
by jfeger
You're much deeper into it than I was able to get...so that is progress. I wonder if there is a hack we could do where we manually define it to get around the error, then see if it updates properly

Re: Room-O-Matic Contributed

PostPosted: Sun Jan 24, 2016 6:43 am
by DaveL17
The plugin is expecting a date in this format: Y-m-d H:M:S (which is 2016-01-24 12:34:56) but it's instead getting only this: " 00:00:00" which leads me to believe that the device state "lastreset" is empty when the plugin is run. So what's missing is something like this pseudo-code:

Code: Select all
if the value of the device state "lastreset" is empty:
  set the value of the device state "lastreset" to a valid value

Somewhere in the plugin, you should set the value of the device state "lastreset" to a default value to set things up. If this hasn't been done, it will lead to the problem you're seeing. As a test, try replacing the code snippet above with:
Code: Select all
def runConcurrentThread(self):
      try:
         while True:
            dev = indigo.devices[self.dev]
            if dev.states["lastreset"] == "":
                dev.updateStateOnServer("lastreset", d.strftime(indigo.server.getTime(), "%Y-%m-%d ") )
            s = epsdtutils.DateDiff ("hours", indigo.server.getTime(), str(dev.states["lastreset"]) + " 00:00:00")
            if s > 24:
               self.hlreset()
            self.sleep(1)
      except self.StopThread:
         pass   # Optionally catch the StopThread exception and do any needed cleanup.

We may have to tweak this slightly to get it to work, but we might get lucky. :)

But once that's done, I think you might yet see another error based on this line within the method hlreset() based on what you've posted above:
Code: Select all
dev.updateStateOnServer("lastreset", d.strftime("%Y-%m-%d ") )

because that line is incomplete. The function is trying to set the value of the device state "lastreset" to something, but it doesn't have all the parameters it needs to do that. It should instead be something like we used above:
Code: Select all
dev.updateStateOnServer("lastreset", d.strftime(indigo.server.getTime(), "%Y-%m-%d ") )


Make a copy of the plugin and then try the two changes above and see if that doesn't get you going.
Dave

Re: Room-O-Matic Contributed

PostPosted: Wed Mar 30, 2016 11:13 pm
by jfeger
@DaveL17, you are the MAN! Sorry for the long delayed reply to you, but I have been away from the project for a while. Between you pointing me in the right direction, and coupled with an Intro to Programming class I am taking, I think we are officially working. You pointed me to the right block of code, and your fix suggestion was very close.

In short summary, this is what we needed to do:

1. I added your block of code. (Not the second single line, just the block)
2. I received an error about strftime only accepting one argument, but we provided two, counting the indigo.server.getTime().
3. I changed the d.strftime object to use just the time formatting you provided.
4. The next error would complain about 'd' not being defined, so I defined 'd' in the same block, and used it call indigo.server.getTime()

This seems to have fixed all of the errors. If someone tries this and they see weird errors still, its likely because you havent yet defined the Device (Acme CP). Once I did that and reloaded the module, it starts error free and all functions are working.

Thanks again DaveL17, that was a HUGE help. Also thank you to my instructor in my current Java class, as I actually used what ive learned. :)

Code: Select all
       #
        # Thread operation
        #
        def runConcurrentThread(self):
                try:
                        while True:
                                d = indigo.server.getTime()  ###  This line added by jfeger to avoid an error at runtime.  2016-03-30
                                dev = indigo.devices[self.dev]
                                if dev.states["lastreset"] == "":  ### Check for a lastreset value, and if not set, execute a set.  DaveL / jfeger.  2016-03-30
                                        dev.updateStateOnServer("lastreset", d.strftime("%Y-%m-%d") )  ### Set the lastreset parameter based on 'd' time value.  DaveL / jfeger 2016-03-30
                                s = epsdtutils.DateDiff ("hours", indigo.server.getTime(), str(dev.states["lastreset"]) + " 00:00:00")
                                if s > 24:
                                        self.hlreset()

                                self.sleep(1)

                except self.StopThread:
                        pass    # Optionally catch the StopThread exception and do any needed cleanup.



Re: Room-O-Matic Contributed

PostPosted: Wed Mar 30, 2016 11:18 pm
by jfeger
I just sent a PM to the author, maybe he will incorporate the fix into the package.

Thanks again Dave. Also thanks to IndigoSam for pointing us in the right direction initially. Im pumped about this working now. Its very slick.

Re: Room-O-Matic Contributed

PostPosted: Thu Mar 31, 2016 3:49 am
by DaveL17
Glad to hear that you were able to get it going! Happy to have helped.


Sent from my iPhone using Tapatalk

Re: Room-O-Matic Contributed

PostPosted: Fri Apr 01, 2016 3:31 am
by IndigoSam
This is great news! I really like the aesthetics of this, so good to get it working.

I am wondering if the original author has now moved on.

Sam.

Re: Room-O-Matic Contributed

PostPosted: Fri Apr 01, 2016 5:15 am
by Londonmark
IndigoSam wrote:
I am wondering if the original author has now moved on.
Sam.


I think he must have done - haven't heard anything from him for ages, and not had replies to private messages. Shame. I also love this set-up (although haven't had time to exploit it to the full).

Re: Room-O-Matic Contributed

PostPosted: Fri Apr 01, 2016 5:17 am
by howartp
If someone can send the finished (modified) version to Support, they should be able to upload it in place of the old one.


Sent from my iPhone using Tapatalk

Re: Room-O-Matic Contributed

PostPosted: Fri Apr 01, 2016 9:51 am
by matt (support)
Yes, if someone will email it to us and we'll update the download on our site with the fixed version.

Re: Room-O-Matic Contributed

PostPosted: Tue Apr 05, 2016 10:21 am
by matt (support)
I just posted the new bug fix version. Thanks for submitting it!

Re: Room-O-Matic Contributed

PostPosted: Tue May 03, 2016 9:06 am
by jfeger
Great, thanks.

I just received a note from the developer, he is still active, just hasn't had time to check-in. Good news we haven't lost a good one! :)

Re: Room-O-Matic Contributed

PostPosted: Tue May 03, 2016 9:13 am
by Colorado4Wheeler
I'll have to take a closer look, the last reset is in there to see how long it has been since the values were set back to default.

Re: Room-O-Matic Contributed

PostPosted: Tue May 03, 2016 9:16 am
by Colorado4Wheeler
I'm actually looking at doing some updates to ROM, I've been super busy with other projects and since this has been working so well for me I just was inconsiderate of the rest of you folks by not doing updates. Very sorry about that, Mia Culpa!

Re: Room-O-Matic Contributed

PostPosted: Tue May 03, 2016 10:37 am
by Londonmark
Good to see you're back. And looking forward to whatever updates you have in mind!

Re: Room-O-Matic Contributed

PostPosted: Sun May 29, 2016 7:15 am
by srkinard
Very interested in using the plugin to split numbers into the individual digits...I like the old style 7-segment LED display.

I downloaded the package and this is what I got when I installed the plugin (quickly deactivated it to stop the error loop)

Code: Select all
  Installing and enabling plugin Acme Future Home CPanel System v1.1.1
  Error                           XML Parse Error: not well-formed (invalid token)
  Error                           On character 61 of line number 21.
  Loading plugin "Acme Future Home CPanel System 1.1.1"
  Starting plugin "Acme Future Home CPanel System 1.1.1" (pid 22162)
  Started plugin "Acme Future Home CPanel System 1.1.1"
  Acme Future Home CPanel System Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 251, in runConcurrentThread
AttributeError: 'Plugin' object has no attribute 'dev'

  Acme Future Home CPanel System Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Acme Future Home CPanel System Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 251, in runConcurrentThread
AttributeError: 'Plugin' object has no attribute 'dev'

  Acme Future Home CPanel System Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Acme Future Home CPanel System Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 251, in runConcurrentThread
AttributeError: 'Plugin' object has no attribute 'dev'

  Acme Future Home CPanel System Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Acme Future Home CPanel System Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 251, in runConcurrentThread
AttributeError: 'Plugin' object has no attribute 'dev'

  Acme Future Home CPanel System Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Acme Future Home CPanel System Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 251, in runConcurrentThread
AttributeError: 'Plugin' object has no attribute 'dev'

  Acme Future Home CPanel System Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Acme Future Home CPanel System Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 251, in runConcurrentThread
AttributeError: 'Plugin' object has no attribute 'dev'

  Acme Future Home CPanel System Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Error                           XML Parse Error: not well-formed (invalid token)
  Error                           On character 61 of line number 21.
  Disabling plugin "Acme Future Home CPanel System 1.1.1"
  Stopping plugin "Acme Future Home CPanel System 1.1.1" (pid 22162)
  Stopped plugin "Acme Future Home CPanel System 1.1.1"


Any ideas on what to check?

Downloaded your recent plugins and have started tinkering with things to do with them...cool stuff. Between these and Karl's plugins I find myself really absorbed into experimenting with various configs.