[LOCKED] iFindstuff Alpha Testing Topic

Posted on
Wed Sep 02, 2015 1:41 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: iFindstuff Alpha Testing Topic

Hi Mike.
I tried your script to update position on request, but I get an error when I try to compile the script. I am not sure why you try to import indigo?

Code: Select all
Script Error                    embedded script: invalid syntax
  Script Error                    around line 1 - "import indigo
import time

# Calculate a new refresh time - local time returns the number of seconds since 1/1/1970
for dev in indigo.devices.iter('self.AppleDeviceAuto')

     if dev.configured and dev.enabled:
        # Get the number of seconds since the epoch for the time now
        # Remove 10 seconds to force an update
        iNow= time.mktime(time.localtime())-10

        # Convert that to something a human can actually read
        iRead = time.asctime(iNow)

        # Update the device on the server   
        dev.updateStateOnServer(‘timeNextUpdate’, value=iNow)
        dev.updateStateOnServer(‘timeUpdateRead’, value=iRead)"


Do you have any suggestions?

Håvard

Håvard

Posted on
Wed Sep 02, 2015 5:52 am
evansgo offline
Posts: 223
Joined: Nov 29, 2013

Re: iFindstuff Alpha Testing Topic

I'm no Python expert but I suspect from your error that you are trying to run the script in the wrong place.
I believe that you should be in the actions menu (Execute Script (Script and File Actions) and select embedded Python.

Posted on
Wed Sep 02, 2015 5:55 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: iFindstuff Alpha Testing Topic

That is what I have done...

Håvard

Posted on
Wed Sep 02, 2015 6:06 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindstuff Alpha Testing Topic

haavarda wrote:
That is what I have done...


I'll trial it first ting tonight and let you know what happens... it's strange because that should work without a problem - even importing indigo.

import indigo is a standard command in python so I can't think why it has an issue.

What you could do is remove all of the space before commands and replace them with four spaces (or a tab).

e.g.

import indigo
import time
for dev in indigo.devices.iter('se;f.iAppleDeviceAuto')
xxxxdo something

Posted on
Wed Sep 02, 2015 6:14 am
evansgo offline
Posts: 223
Joined: Nov 29, 2013

Re: iFindstuff Alpha Testing Topic

Just got home and tried this. It works for me or at least it gets past the import part.

Try deleting it all and copying it again in case something got corrupted.

But I am getting a script error on the for dev in indigo line, just looking at it now, but also noted that the last two dev.updateStateOnServer lines have smart quotes, should they not be normal ones (')?

Posted on
Wed Sep 02, 2015 6:17 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindstuff Alpha Testing Topic

haavarda wrote:
Hi Mike.
I tried your script to update position on request, but I get an error when I try to compile the script. I am not sure why you try to import indigo?

Code: Select all
Script Error                    embedded script: invalid syntax
  Script Error                    around line 1 - "import indigo
import time

# Calculate a new refresh time - local time returns the number of seconds since 1/1/1970
for dev in indigo.devices.iter('self.AppleDeviceAuto')

     if dev.configured and dev.enabled:
        # Get the number of seconds since the epoch for the time now
        # Remove 10 seconds to force an update
        iNow= time.mktime(time.localtime())-10

        # Convert that to something a human can actually read
        iRead = time.asctime(iNow)

        # Update the device on the server   
        dev.updateStateOnServer(‘timeNextUpdate’, value=iNow)
        dev.updateStateOnServer(‘timeUpdateRead’, value=iRead)"


Do you have any suggestions?

Håvard



I think there's are two typos in the code... my mistake. It's missing a ":" and it's got an extra '"'

It should read:

Code: Select all
import indigo
import time

# Calculate a new refresh time - local time returns the number of seconds since 1/1/1970
for dev in indigo.devices.iter('self.AppleDeviceAuto'): # <- added a missing colon

     if dev.configured and dev.enabled:
        # Get the number of seconds since the epoch for the time now
        # Remove 10 seconds to force an update
        iNow= time.mktime(time.localtime())-10

        # Convert that to something a human can actually read
        iRead = time.asctime(iNow)

        # Update the device on the server   
        dev.updateStateOnServer(‘timeNextUpdate’, value=iNow)
        dev.updateStateOnServer(‘timeUpdateRead’, value=iRead) #<- removed the extra (")


I'll try it tonight but give that a go :D

Regards

Mike

Posted on
Wed Sep 02, 2015 6:24 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindstuff Alpha Testing Topic

mclass wrote:
Thaks for including me in in Alpha testing!

Loaded V0.4.25 successfully and configured my account and phone OK. Geolocation appears to work OK here in the Southern Hemisphere (Australia).

I then set up my wife's account, and attempted to create her iPhone device. However, I experienced similar problems to kw123 - no devices appeared in the drop down menu (just greyed out), despite the her Account Device showing as "Active" with the green dot. Attempts at reloading plugin, restarting computer and server and all sorts of combinations were without success.

In desperation deleted, and recreated my wife's Apple Account Device, and hey presto - there was her phone and iPad.

In experimenting with some of the features, I was able to plot all devices on a map, but then when I attempted to plot a selected device, there were no devices presented in the selection box - just greyed out. Similarly for sending a message to a device. I'm surmising that these are features yet to be implemented?

This is another great plugin, and looking forward to further experimentation. And it's a bit scary how much information you can determine from the device :roll:

Mclass


Karl/Mclass

I think I understand the problem now so I'm going to try a different approach. The problem I'd been having was using the result of one dropdown box as the feed for another in the same dialog. I'd coded a patch workaround to make it happen but clearly it's not flexible enough. I think I've a solution that will improve speed and ensure that all possible devices are provided for you to choose from.

I've also had problems setting defaults in text fields before it's presented to the user for completion. Still working on that logic.

Thanks for all of the feedback - I've got a path to resolution now and I'll try to upload a new version tonight.

There are a couple of features I'm leaving until the next main release. Sending push messages to iPhones (BTW it works really well) and Stationary power management. I only left these because I was keen to stabilise the current features before moving on with new ones.


Regards

Mike

Posted on
Wed Sep 02, 2015 6:30 am
evansgo offline
Posts: 223
Joined: Nov 29, 2013

Re: iFindstuff Alpha Testing Topic

Mike,
Your original code didn't have the extra ", Håvard may have added that by mistake.
But it still did not work.

As I say I'm no expert but changing your smart quotes to ' type quotes made it work on mine...

Code: Select all
import indigo
import time

# Calculate a new refresh time - local time returns the number of seconds since 1/1/1970
for dev in indigo.devices.iter('self.AppleDeviceAuto'):

     if dev.configured and dev.enabled:
        # Get the number of seconds since the epoch for the time now
        # Remove 10 seconds to force an update
        iNow= time.mktime(time.localtime())-10

        # Convert that to something a human can actually read
        iRead = time.asctime(iNow)

        # Update the device on the server   
        dev.updateStateOnServer('timeNextUpdate', value=iNow)
        dev.updateStateOnServer('timeUpdateRead', value=iRead)

Posted on
Wed Sep 02, 2015 7:09 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindstuff Alpha Testing Topic

evansgo wrote:
Mike,
Your original code didn't have the extra ", Håvard may have added that by mistake.
But it still did not work.

As I say I'm no expert but changing your smart quotes to ' type quotes made it work on mine...

Code: Select all
import indigo
import time

# Calculate a new refresh time - local time returns the number of seconds since 1/1/1970
for dev in indigo.devices.iter('self.AppleDeviceAuto'):

     if dev.configured and dev.enabled:
        # Get the number of seconds since the epoch for the time now
        # Remove 10 seconds to force an update
        iNow= time.mktime(time.localtime())-10

        # Convert that to something a human can actually read
        iRead = time.asctime(iNow)

        # Update the device on the server   
        dev.updateStateOnServer('timeNextUpdate', value=iNow)
        dev.updateStateOnServer('timeUpdateRead', value=iRead)


Good result. I shouldn't have used WORD to generate the code should I? :roll:

Mike

Posted on
Wed Sep 02, 2015 7:57 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: iFindstuff Alpha Testing Topic

Mike
The problem I'd been having was using the result of one dropdown box as the feed for another in the same dialog.


YES!! The sequence of the callbacks and filters is not set and can change. It would be a real improvement if that could be controllable.
This creates a lot of work around and I had to add an extra button in many menus to make sure that info was available
ie
select xx menue
then confirm button to make sure that the information is in plugin
then next step


Karl
Last edited by kw123 on Wed Sep 02, 2015 9:12 am, edited 1 time in total.

Posted on
Wed Sep 02, 2015 8:36 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindstuff Alpha Testing Topic

kw123 wrote:
Mike
The problem I'd been having was using the result of one dropdown box as the feed for another in the same dialog.


YES!! The sequence of the callbacks and filters is not given and can change. It would be a real improvement if that could be controllable.
This creates a lot of work around and I had to add an extra button in many menus to make sure that info was available
ie
select xx menue
then confirm button to make sure that the information is in plugin
then next step


Karl


This is clearly a sore point with you as well. Of course now I understand why you had that design in indiGOplot :D

I've decided to do something with directories etc...

Regards

Mike

Posted on
Wed Sep 02, 2015 10:04 pm
artpics offline
Posts: 232
Joined: Feb 24, 2009
Location: Calabasas CA

Re: iFindstuff Alpha Testing Topic

Yesterday i let FMstuff manage the timer i was at different locations for many hours the phone updated once or twice.
Today i turned the timer off and stationary mode and it updated great, very accurate and the address was spot on every time.

will turn the timer back on and stationary mode and tomorrow see my results.

in the device my settings are.
normal = 60
50% 180
40% 300
30% 600

Posted on
Thu Sep 03, 2015 1:53 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: iFindstuff Alpha Testing Topic

artpics wrote:
Yesterday i let FMstuff manage the timer i was at different locations for many hours the phone updated once or twice.
Today i turned the timer off and stationary mode and it updated great, very accurate and the address was spot on every time.

will turn the timer back on and stationary mode and tomorrow see my results.

in the device my settings are.
normal = 60
50% 180
40% 300
30% 600


Cool just the testing we need. How's battery life?

M

Posted on
Thu Sep 03, 2015 7:45 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: iFindstuff Alpha Testing Topic

Mike,
V 0.4.28 works much better, get my devices located ...

tried to stress test it by doing things in the wrong sequence in the iDevice menu and got this error message:
Code: Select all
 iFindStuff                      Custom API fields set up correctly...
  iFindStuff                      Waiting for devices...
  iFindStuff                      Updated Geo Key for:<home>
  iFindStuff                      Standard API fields set up correctly...
  iFindStuff                      Custom API fields set up correctly...
  iFindStuff                      Waiting for devices...
  iFindStuff                      Standard API fields set up correctly...
  iFindStuff                      Custom API fields set up correctly...
  iFindStuff                      Waiting for devices...
  iFindStuff Error                Error in plugin execution UiAction:

Traceback (most recent call last):
  File "plugin.py", line 2333, in selectedDevice
<type 'exceptions.KeyError'>: key not found in database

  iFindStuff Error                Error in plugin execution UiAction:

Traceback (most recent call last):
  File "plugin.py", line 2333, in selectedDevice
<type 'exceptions.KeyError'>: key not found in database

  iFindStuff                      P1
  iFindStuff                      P2
  iFindStuff                      P1
  iFindStuff                      P2
  iFindStuff                      Standard API fields set up correctly...
  iFindStuff                      Custom API fields set up correctly...
  iFindStuff                      Waiting for devices...
  iFindStuff                      Standard API fields set up correctly...
  iFindStuff                      Custom API fields set up correctly...
  iFindStuff                      Waiting for devices...



Karl

Posted on
Thu Sep 03, 2015 11:25 pm
evansgo offline
Posts: 223
Joined: Nov 29, 2013

Re: iFindstuff Alpha Testing Topic

I've just seen a "Failed login... " Message in my log, (v0.4.28) I cannot see any more as I was looking via the iOS app and am not at home, but it previously had tracked me leaving home and arriving at work, so was working ok and nothing had changed as far as I'm aware


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 3 guests