Hotfix version 1.0.37 - calculation update

Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Hotfix version 1.0.37 - calculation update

Post by Chameleon »

Hi all

A couple of updates:

1. Non-int sequence error - TOPS identified a minor bug that would impact any user using Imperial measurements. It causes the calculation on some devices to fail.

You may get the error message:
  • File "plugin.py", line 589, in iRefreshDevices
    File "plugin.py", line 1028, in updateDevice
    <type 'exceptions.TypeError'>: can't multiply sequence by non-int of type 'float'

    iFindStuff Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
in the log. A hotfix has been released (1.0.37) to resolve this issue. There are no other updates made to the plugin.

You can download the latest version (1.0.37) from this link:

https://www.dropbox.com/s/vtnxa5ssxvrog ... f.zip?dl=1

2. If you're using the NEST Home functionality you may get the following error:
  • Error device "First Floor Nest Protect " state key battery_alarm_bool not defined (ignoring update request)
    Error device "First Floor Nest Protect " state key co_alarm_bool not defined (ignoring update request)
    Error device "First Floor Nest Protect " state key smoke_alarm_bool not defined (ignoring update request)
    Error device "Ground Floor Nest Protect " state key battery_alarm_bool not defined (ignoring update request)
    Error device "Ground Floor Nest Protect " state key co_alarm_bool not defined (ignoring update request)
    Error device "Ground Floor Nest Protect " state key smoke_alarm_bool not defined (ignoring update request)
This is caused by your NEST Home installation being out of date. To use the iFindStuff NEST Integration you must be using version 2.0.20 of NEST Home. I recommend that you update immediately if you're using NEST Home and iFindStuff functionality.

Wasn't sure how to trap that particular error but I am now. A fix will in the next version after this Hotfix (1.0.37).

In the meantime you should upgrade your NEST Home from this forum:

http://forums.indigodomo.com/viewtopic. ... 70&t=14720

Thanks as always for the communications.

Regards

Mike
User avatar
TOPS
Posts: 169
Joined: Wed Jun 17, 2015 10:57 am
Location: London, England

Re: Hotfix version 1.0.37 - calculation update

Post by TOPS »

Hi Mike,

Nice one on that, another little think i have just noticed, my devices do not seem to be updating as scheduled, my wife and son are on their way to Harry Potter World in Watford, great time to test the plugin, as you can see from the shot below the first device has not updated the phones position yet (real time and time to next update) if I reload the plugin the times update......

any thoughts

Dave
Attachments
IMG_0001.PNG
IMG_0001.PNG (160.36 KiB) Viewed 4337 times
nev
Posts: 48
Joined: Wed Aug 19, 2015 8:29 am

Re: Hotfix version 1.0.37 - calculation update

Post by nev »

Thanks for separating the Active/Inactive toggles for iDevices, works great! Do you think you will separate out the "Change update frequency to or from variable" into two options as well?

I know how much work you are putting into this and we all sensually appreciate it! Home Kit doesn't stand a chance to these features and functionality.
User avatar
TOPS
Posts: 169
Joined: Wed Jun 17, 2015 10:57 am
Location: London, England

Re: Hotfix version 1.0.37 - calculation update

Post by TOPS »

Hi Mike.....

forgot to add...the map is not updating either.....

Cheers,

Dave
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Hotfix version 1.0.37 - calculation update

Post by Chameleon »

TOPS wrote:Hi Mike.....

forgot to add...the map is not updating either.....

Cheers,

Dave
Do the maps and devices update on a reload?

Do you have the Option for variable frequency control checked in the configuration?
Are iPad maps and iPhone maps switched on in the configuration dialog?

What concerns me is a hidden error that's not displaying. For that I'll need a log - first with debug1 and debug2 options and then another with just debug3 option on. There's something that causing a hidden crash and a loop but without the logs I'll never find it. You could inactivate devices one at a time (only one device inactive at a time) to see if it's a specific device that's causing the error. If it is have a look at the configuration for that specific device.

With these logs I should be able to work out exactly where the problem lies and repair it.

Can you download a slightly different version from the link I PM'd you?

as I've corrected another minor bug (but I doubt it's the one that causing your problem) and removes a lot of the GeoFence calculation noise from the Indigo Log when you have all three debugs on. From this I'll be able to workout the location of an issue and correct it. I suspect it's minor and related to one of your devices.

Regards

Mike
User avatar
TOPS
Posts: 169
Joined: Wed Jun 17, 2015 10:57 am
Location: London, England

Re: Hotfix version 1.0.37 - calculation update

Post by TOPS »

Morning Mike :roll:

I'm getting the error below,(3rd & 4th line) any ideas?

Cheers,

Dave

4 Oct 2015 12:28:17
iFindStuff Setting up the Custom API...
iFindStuff Setting up the Custom API...
Error (client) timeout waiting for plugin response from com.corporatechameleon.iFindplugBeta for request UiClosed2
Error (client) received unexpected packet response UiClosed2 (waiting for CalcDeviceFunc)
iFindStuff Setting up the Custom API...
iFindStuff Setting up the Custom API...
iFindStuff Device update (l/l):House iPad Remote -0.442384973839
iFindStuff Device update (l/l):House iPad Remote 51.5422620886
Error email scan authentication failed
iFindStuff Found key:WoT5LRyddk+dmbqHlL2Fp5aBT6PuEb1ou3K0iIOtwOjGgcFpvBtDyeHYVNSUzmWV
iFindStuff Found key:OuTBtT49BJqb7yvTs+pnf/r7FEIyDMfKEAfn/ZSzAef7ipJWfXZfDuHYVNSUzmWV
iFindStuff Found key:87hkFw5avDxqYdApOjjvDMta+DP928J/lrgfAcw8snLpTlkwbJCHwuHYVNSUzmWV
iFindStuff Found key:fQ+CLnWQ6VahY+Ga/oBKNN3TS82konXywXUppWNoAU+bcIrTMmp3JQ==
iFindStuff Found key:LcSd7ArkQ3uhT82/zwXtOBFJYsH/Ch14aMPiWHUww034nvk3T7drnw==
iFindStuff Found key:O6WpZnTxE4l4lx8GzsH9+KVWy910FyT4BgtTDMz0iIZbQ+bFrLPbgfAlle0OWZZgElBmBIwSo5vdY6Nb4ELBShCcZf8ij+H4q8+Vp/P6+SedkFlwBd+4HQ==
iFindStuff Found key:WiNZhzoiX1WNR/TBq3sOpdf2htLA40krrtCt0YR7duiW9qEO09MWa9OT4HJ7GfRWU6Eq+C2XxsTdY6Nb4ELBSm9gfEF65YF1IaWNesEXwEuWJDsgge417w==
iFindStuff Found key:wzGoIloIPFMH1myI8DGf0j903+2dP7x5IbxgzOFZQ5yFQnp1MAa/8+HYVNSUzmWV
iFindStuff Found key:AUPxkaYWMNZ/zxkk8cilPeN/iflOkObHnTHUhq7El/EMe345BUbv4OHYVNSUzmWV
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Hotfix version 1.0.37 - calculation update

Post by Chameleon »

TOPS wrote:Morning Mike :roll:

I'm getting the error below,(3rd & 4th line) any ideas?

Cheers,

Dave

4 Oct 2015 12:28:17
iFindStuff Setting up the Custom API...
iFindStuff Setting up the Custom API...
Error (client) timeout waiting for plugin response from com.corporatechameleon.iFindplugBeta for request UiClosed2
Error (client) received unexpected packet response UiClosed2 (waiting for CalcDeviceFunc)
iFindStuff Setting up the Custom API...
iFindStuff Setting up the Custom API...
iFindStuff Device update (l/l):House iPad Remote -0.442384973839
iFindStuff Device update (l/l):House iPad Remote 51.5422620886
Error email scan authentication failed
iFindStuff Found key:WoT5LRyddk+dmbqHlL2Fp5aBT6PuEb1ou3K0iIOtwOjGgcFpvBtDyeHYVNSUzmWV
iFindStuff Found key:OuTBtT49BJqb7yvTs+pnf/r7FEIyDMfKEAfn/ZSzAef7ipJWfXZfDuHYVNSUzmWV
iFindStuff Found key:87hkFw5avDxqYdApOjjvDMta+DP928J/lrgfAcw8snLpTlkwbJCHwuHYVNSUzmWV
iFindStuff Found key:fQ+CLnWQ6VahY+Ga/oBKNN3TS82konXywXUppWNoAU+bcIrTMmp3JQ==
iFindStuff Found key:LcSd7ArkQ3uhT82/zwXtOBFJYsH/Ch14aMPiWHUww034nvk3T7drnw==
iFindStuff Found key:O6WpZnTxE4l4lx8GzsH9+KVWy910FyT4BgtTDMz0iIZbQ+bFrLPbgfAlle0OWZZgElBmBIwSo5vdY6Nb4ELBShCcZf8ij+H4q8+Vp/P6+SedkFlwBd+4HQ==
iFindStuff Found key:WiNZhzoiX1WNR/TBq3sOpdf2htLA40krrtCt0YR7duiW9qEO09MWa9OT4HJ7GfRWU6Eq+C2XxsTdY6Nb4ELBSm9gfEF65YF1IaWNesEXwEuWJDsgge417w==
iFindStuff Found key:wzGoIloIPFMH1myI8DGf0j903+2dP7x5IbxgzOFZQ5yFQnp1MAa/8+HYVNSUzmWV
iFindStuff Found key:AUPxkaYWMNZ/zxkk8cilPeN/iflOkObHnTHUhq7El/EMe345BUbv4OHYVNSUzmWV
It will work fine... Because the device dialog is so large it takes more than 10 seconds and indigo doesn't like that much. I'm going to have to optimise the code to make it quicker - probably this week. The edits still work Ok tho...

Regards

Mike
User avatar
TOPS
Posts: 169
Joined: Wed Jun 17, 2015 10:57 am
Location: London, England

Re: Hotfix version 1.0.37 - calculation update

Post by TOPS »

Hi Mike,

Ok, I'll see how it goes,

Cheers,

Dave
nev
Posts: 48
Joined: Wed Aug 19, 2015 8:29 am

Re: Hotfix version 1.0.37 - calculation update

Post by nev »

I've been playing with the "Bearing to Home" feature as a condition. In order to determine if i'm on my way home, can i use .... if "Bearing to Home" is between -30 & 30? It doesn't seem to work. I tried NW to NE, but the non-numerical values are not accepted either.
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Hotfix version 1.0.37 - calculation update

Post by Chameleon »

nev wrote:I've been playing with the "Bearing to Home" feature as a condition. In order to determine if i'm on my way home, can i use .... if "Bearing to Home" is between -30 & 30? It doesn't seem to work. I tried NW to NE, but the non-numerical values are not accepted either.
Nev

The Bearing to Home is a calculated field with a value of 0-359.99 (as 0 degrees is also 360 degrees) so it's never negative. I know what you want to do but the number is telling you the bearing to home not a range. I could add the feature in the next release later this week.

In the meantime - you could have a trigger that happens whenever there's a change in the Bearing to Home for a device. That trigger would then have some embedded python code that determined if it was in the range you had in mind and, if it was, it would alter a variable flag from false to true.

For example - I want to check a phone called Stuart iPhone 6

I create a trigger for the iDevice (in this case Stuarts iPhone 6):
Bearing Trigger
Bearing Trigger
Screen Shot 2015-10-07 at 15.00.07.png (54.93 KiB) Viewed 4102 times
Notice I've used the Bearing to Home as a trigger.

The condition I leave blank but obviously you could add other conditions here...

Now I create a Server action using Execute Script and put the following code in the embedded python box
Calculate range for bearing...
Calculate range for bearing...
Screen Shot 2015-10-07 at 15.07.58.png (140.82 KiB) Viewed 4102 times
Here is the code for pasting...

Code: Select all

# Calculates if a bearing is between two points
iRange = 10
# iRange could be stored in an Indigo variable and extracted at this point

if iRange>179.0 or iRange<0.0:
	indigo.server.log("Range must be in between 0 and 179 degrees", isError=True)
else:
	# iTargetBearing could be stored in an Indigo variable and extracted at this point
	iTargetBearing = 220.0
	iLow = iTargetBearing - iRange
	iHigh = iTargetBearing + iRange

	# Get the device bearing
	dev = indigo.devices[687070728] # "Stuarts iPhone 6"
	currentBearing = dev.states['directionDegree']

	if iLow<0:
		iHigh = iHigh+abs(iLow)
		currentBearing = currentBearing+abs(iLow)
		iLow = 0.0

	if iHigh>360:
		iLow = iLow - abs(iHigh-360.0)
		currentBearing = currentBearing-abs(iHigh-360.)
		iHigh = 360.0

	# Store the Bearing in Range (True or False in a variable)
	bearingVariable = indigo.variables[1515373767] # "STUARTBEARINGRANGE"
	indigo.variable.updateValue(bearingVariable, str(currentBearing<=iHigh and currentBearing >= iLow))
This code can be edited to suit or you can use indigo variables to state the +/- range and the target bearing. I know the code looks a little complicated but it ensures that regardless of the bearing and target values it returns the correct answer. Finally, based on the result of the calculation it sets an indigo variable (STUARTBEARINGRANGE) to true or false. That could be used to trigger other events.

I'll look into including the feature in iFindStuff but this method does work :D

Regards

Mike
rapamatic
Posts: 283
Joined: Mon Aug 03, 2015 2:54 pm
Location: Glencoe, IL

Re: Hotfix version 1.0.37 - calculation update

Post by rapamatic »

I am getting math domain errors when I first load the plugin, before it has assigned my devices to a geofence. Once I get the log messages that devices have been assigned to geofences, the errors go away:

Code: Select all

Starting plugin "iFindStuff 1.0.37" (pid 1838)
  Started plugin "iFindStuff 1.0.37"
  iFindStuff                      iFind Dominika's iPhone 6S Home
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3075, in runConcurrentThread
  File "plugin.py", line 1431, in nextUpdateCalc
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3032, in runConcurrentThread
  File "plugin.py", line 514, in iMapping
  File "plugin.py", line 589, in iRefreshDevices
  File "plugin.py", line 1018, in updateDevice
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Lutron RadioRA 2                Received: Dimmer Basement Stairs - Overhead level set to 0.00
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3032, in runConcurrentThread
  File "plugin.py", line 514, in iMapping
  File "plugin.py", line 589, in iRefreshDevices
  File "plugin.py", line 1018, in updateDevice
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  iFindStuff                      iFind Dominika's iPhone 6S Home
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3075, in runConcurrentThread
  File "plugin.py", line 1431, in nextUpdateCalc
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  iFindStuff                      iFind Dominika's iPhone 6S Home
  iFindStuff                      iFind Ray's iPhone 6S Home
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Hotfix version 1.0.37 - calculation update

Post by Chameleon »

rapamatic wrote:I am getting math domain errors when I first load the plugin, before it has assigned my devices to a geofence. Once I get the log messages that devices have been assigned to geofences, the errors go away:

Code: Select all

Starting plugin "iFindStuff 1.0.37" (pid 1838)
  Started plugin "iFindStuff 1.0.37"
  iFindStuff                      iFind Dominika's iPhone 6S Home
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3075, in runConcurrentThread
  File "plugin.py", line 1431, in nextUpdateCalc
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3032, in runConcurrentThread
  File "plugin.py", line 514, in iMapping
  File "plugin.py", line 589, in iRefreshDevices
  File "plugin.py", line 1018, in updateDevice
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  Lutron RadioRA 2                Received: Dimmer Basement Stairs - Overhead level set to 0.00
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3032, in runConcurrentThread
  File "plugin.py", line 514, in iMapping
  File "plugin.py", line 589, in iRefreshDevices
  File "plugin.py", line 1018, in updateDevice
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  iFindStuff                      iFind Dominika's iPhone 6S Home
  iFindStuff Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 3075, in runConcurrentThread
  File "plugin.py", line 1431, in nextUpdateCalc
  File "plugin.py", line 1653, in iDistance
<type 'exceptions.ValueError'>: math domain error

  iFindStuff Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  iFindStuff                      iFind Dominika's iPhone 6S Home
  iFindStuff                      iFind Ray's iPhone 6S Home

Thanks Ray... I'll trap it out tomorrow. It won't impact anything but I hate error messages for no reason.

Regards

Mike
nev
Posts: 48
Joined: Wed Aug 19, 2015 8:29 am

Re: Hotfix version 1.0.37 - calculation update

Post by nev »

Chameleon wrote:
nev wrote:I've been playing with the "Bearing to Home" feature as a condition. In order to determine if i'm on my way home, can i use .... if "Bearing to Home" is between -30 & 30? It doesn't seem to work. I tried NW to NE, but the non-numerical values are not accepted either.

This code can be edited to suit or you can use indigo variables to state the +/- range and the target bearing. I know the code looks a little complicated but it ensures that regardless of the bearing and target values it returns the correct answer. Finally, based on the result of the calculation it sets an indigo variable (STUARTBEARINGRANGE) to true or false. That could be used to trigger other events.

I'll look into including the feature in iFindStuff but this method does work :D
Thanks Mike! I'll try it out!
Post Reply

Return to “iFindStuff”