Room-O-Matic Contributed

Posted on
Sat Jan 23, 2016 10:29 pm
jfeger offline
Posts: 84
Joined: Jan 02, 2013

Re: Room-O-Matic Contributed

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

Posted on
Sun Jan 24, 2016 6:43 am
DaveL17 offline
User avatar
Posts: 5897
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Room-O-Matic Contributed

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

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

[My Plugins] - [My Forums]

Posted on
Wed Mar 30, 2016 11:13 pm
jfeger offline
Posts: 84
Joined: Jan 02, 2013

Re: Room-O-Matic Contributed

@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.



Posted on
Wed Mar 30, 2016 11:18 pm
jfeger offline
Posts: 84
Joined: Jan 02, 2013

Re: Room-O-Matic Contributed

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.

Posted on
Thu Mar 31, 2016 3:49 am
DaveL17 offline
User avatar
Posts: 5897
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Room-O-Matic Contributed

Glad to hear that you were able to get it going! Happy to have helped.


Sent from my iPhone using Tapatalk

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

[My Plugins] - [My Forums]

Posted on
Fri Apr 01, 2016 3:31 am
IndigoSam offline
Posts: 182
Joined: Apr 14, 2013

Re: Room-O-Matic Contributed

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.

Posted on
Fri Apr 01, 2016 5:15 am
Londonmark offline
Posts: 401
Joined: Feb 29, 2012

Re: Room-O-Matic Contributed

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).

Posted on
Fri Apr 01, 2016 5:17 am
howartp offline
Posts: 4258
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Room-O-Matic Contributed

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

Posted on
Fri Apr 01, 2016 9:51 am
matt (support) offline
Site Admin
User avatar
Posts: 20538
Joined: Jan 27, 2003
Location: Texas

Re: Room-O-Matic Contributed

Yes, if someone will email it to us and we'll update the download on our site with the fixed version.

Image

Posted on
Tue Apr 05, 2016 10:21 am
matt (support) offline
Site Admin
User avatar
Posts: 20538
Joined: Jan 27, 2003
Location: Texas

Re: Room-O-Matic Contributed

I just posted the new bug fix version. Thanks for submitting it!

Image

Posted on
Tue May 03, 2016 9:06 am
jfeger offline
Posts: 84
Joined: Jan 02, 2013

Re: Room-O-Matic Contributed

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! :)

Posted on
Tue May 03, 2016 9:13 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Room-O-Matic Contributed

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.

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 May 03, 2016 9:16 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Room-O-Matic Contributed

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!

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 May 03, 2016 10:37 am
Londonmark offline
Posts: 401
Joined: Feb 29, 2012

Re: Room-O-Matic Contributed

Good to see you're back. And looking forward to whatever updates you have in mind!

Posted on
Sun May 29, 2016 7:15 am
srkinard offline
Posts: 292
Joined: Apr 10, 2016
Location: Austin, Texas

Re: Room-O-Matic Contributed

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.

Who is online

Users browsing this forum: No registered users and 1 guest