Dynamic Control Plugin

Posted on
Mon Sep 18, 2017 6:58 pm
Vig offline
Posts: 58
Joined: Oct 06, 2015

Re: Dynamic Control Plugin

When I try to create a device I get the error messages on the picture. Also, when trying to disable it doesn't seem to gracefully go down. Any idea?

Error process (pid 620) failed to quit after polite request -- forcing it to quit now
Stopped plugin "Dynamic Control 1.1.0"

Indigo Cocoa client authenticated (172.16.32.151)
Error (client) timeout waiting for plugin response from com.bertmartin.DynamicButton for request CalcDeviceFunc
Error (client) timeout waiting for plugin response from com.bertmartin.DynamicButton for request UiGetValues2
Error (client) timeout waiting for plugin response from com.bertmartin.DynamicButton for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
Error (client) received unexpected packet response CalcDeviceFunc (waiting for CallPluginFunc)
Attachments
Screen Shot 2017-09-18 at 8.51.14 PM.jpg
Screen Shot 2017-09-18 at 8.51.14 PM.jpg (289.93 KiB) Viewed 578 times

Posted on
Mon Sep 18, 2017 9:13 pm
bkmar1192 offline
Posts: 276
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

Hmmmm.... haven't experienced that one before. Have you opened the configuration on the plugin itself (from the plugin's menu) and then saved it?

I'll take look at the code too and see if I can trace it.


Sent from my iPhone using Tapatalk

Posted on
Mon Sep 18, 2017 10:38 pm
Vig offline
Posts: 58
Joined: Oct 06, 2015

Re: Dynamic Control Plugin

I don't see that option:
Attachments
Screen Shot 2017-09-19 at 12.36.49 AM.png
Screen Shot 2017-09-19 at 12.36.49 AM.png (354.08 KiB) Viewed 560 times

Posted on
Tue Sep 19, 2017 8:44 am
bkmar1192 offline
Posts: 276
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

Sorry, that is correct - I was thinking of one if my other plugins. I'll take another look tonight.


Sent from my iPhone using Tapatalk

Posted on
Thu Sep 21, 2017 9:55 pm
bkmar1192 offline
Posts: 276
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

OK - the following post has some possible information. a couple things to try is to uninstall and reinstall Pillow. they also suggest installing pillow from within python. The three commands that are used are:

from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw

So they should all be fine...

https://stackoverflow.com/questions/886 ... -named-pil

** Maybe someone on the board that knows Python a bit better than I can help :D


Sevilsivle wrote:
I followed all the instructions and installed Pillow.
This seems to have been successful, when I repeat the command I get:
Requirement already satisfied: Pillow in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already satisfied: olefile in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from Pillow)

However when I start the PlugIn I get the following error message in the Event Log:

Starting plugin "Dynamic Control 1.1.0" (pid 27455)
Dynamic Control Error Error in plugin execution InitializeMain:

Traceback (most recent call last):
File "plugin.py", line 13, in <module>
ImportError: No module named PIL

Stopping plugin "Dynamic Control 1.1.0" (pid 27455)


What is wrong here?

regards
Tim

Posted on
Fri Sep 22, 2017 11:21 pm
Vig offline
Posts: 58
Joined: Oct 06, 2015

Re: Dynamic Control Plugin

Tried all kinds of uninstalls/installs, same error.. :?
Calling Image/ImageFont/ImageDraw from python/Indigo works though:

# /Library/Application\ Support/Perceptive\ Automation/Indigo\ 7/IndigoPluginHost.app/Contents/MacOS/IndigoPluginHost -i
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
Connected to Indigo Server v7.0.3, api v2.0 (localhost:1176)
>>> from PIL import Image
>>> from PIL import ImageFont
>>> from PIL import ImageDraw
>>>

I searched the forum for the errors I get and found couple threads with exact same messages but on different plugins, here is one of them mentioning the API call timeout:
viewtopic.php?f=212&t=18058&hilit=UiGetValues2&start=15#p135778

I will see if I can find another Mac to run the plugin as a test just in case if python is somehow broken. on my Indigo Server.

Posted on
Sat Sep 23, 2017 10:49 am
bkmar1192 offline
Posts: 276
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

What is odd is that there is really nothing much in my code that is running at that point and the device parameters file is pretty simple.

Couple of other things to try:

1. Check to see if the following directory exists. If it does not then manually create it. Maybe it is having a hard time setting up the directory.
/Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/plugins/DynamicButton/. This is the default it uses for saving images.

2. Delete the preferences file - in case it got corrupted during install.
a. Disable the plugin
b. In the directory: /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins delete (or rename) the com.bertmartin.DynamicButton.indiPref file.

3. Total shot in the dark
a. Create a new device
b. Select "Dynamic Control" in type
c. Before selecting the "Model" uncheck the check box "Enable Indigo Communication"
d. Select the model.

Vig wrote:
When I try to create a device I get the error messages on the picture. Also, when trying to disable it doesn't seem to gracefully go down. Any idea?

Error process (pid 620) failed to quit after polite request -- forcing it to quit now
Stopped plugin "Dynamic Control 1.1.0"

Indigo Cocoa client authenticated (172.16.32.151)
Error (client) timeout waiting for plugin response from com.bertmartin.DynamicButton for request CalcDeviceFunc
Error (client) timeout waiting for plugin response from com.bertmartin.DynamicButton for request UiGetValues2
Error (client) timeout waiting for plugin response from com.bertmartin.DynamicButton for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
Error (client) received unexpected packet response CalcDeviceFunc (waiting for CallPluginFunc)

Posted on
Sat Sep 23, 2017 7:32 pm
Vig offline
Posts: 58
Joined: Oct 06, 2015

Re: Dynamic Control Plugin

bkmar1192 wrote:
1. Check to see if the following directory exists. If it does not then manually create it. Maybe it is having a hard time setting up the directory.
/Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/plugins/DynamicButton/. This is the default it uses for saving images.
2. Delete the preferences file - in case it got corrupted during install.
a. Disable the plugin
b. In the directory: /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins delete (or rename) the com.bertmartin.DynamicButton.indiPref file.


Neither /Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/plugins/DynamicButton directory nor /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins/com.bertmartin.DynamicButton.indiPref file exist. I created the directory manually, then disabled and removed the plugin and reinstalled it but getting the exact same errors.

Also, when I merely try to disable the plugin it's timing out:

Disabling plugin "Dynamic Control 1.1.0"
Stopping plugin "Dynamic Control 1.1.0" (pid 77552)
Error process (pid 77552) failed to quit after polite request -- forcing it to quit now
Stopped plugin "Dynamic Control 1.1.0"

Not sure if it's even the plugin issue, probably the way API calls are handled in Indigo or some security issues in the OS preventing files/directories to be created (I am on the latest macOS 10.12.6)

Posted on
Sat Dec 16, 2017 5:31 pm
tornado offline
User avatar
Posts: 61
Joined: Jun 30, 2014

Re: Dynamic Control Plugin

Please see the PDF instructions in the download for details on installation and use.


I don't see the PDF in the download on GitHub. Was it removed?

Thanks

Posted on
Sat Dec 16, 2017 5:55 pm
tornado offline
User avatar
Posts: 61
Joined: Jun 30, 2014

Re: Dynamic Control Plugin

I tried File:///Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/plugins/DynamicButton/heat1.png (which worked)


Use File://[path] and not http://[path]


This doesn't seem to work for me (file://) and I'm not sure why:

Code: Select all
   Error (client)                  control page image URL invalid: File:///Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/plugins/DynamicButton/testDynamicControl.png


my directory:
Code: Select all
tornado@MacMini DynamicButton $ pwd
/Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/plugins/DynamicButton
tornado@MacMini DynamicButton $ ls
**testDynamicControl.png new_device.png           testDynamicControl.png

Posted on
Sat Dec 16, 2017 6:11 pm
Different Computers offline
User avatar
Posts: 1441
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Control Plugin

isn't it "file" not "File"?

FYI you can drag and drop the target file to get the correct path, but as I recall you still have to put the right prefix in front of it.

SmartThings refugee & happy to be on Indigo now.
Mac OS 10.12.6 on a i5 MBP running Harmony Hub, Hue, DomoPad, Dynamic URL, EPS Device Extensions, HomeBridge Buddy, Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFAP, Wunderground, Airfoil Pro.

Posted on
Sat Dec 16, 2017 7:05 pm
tornado offline
User avatar
Posts: 61
Joined: Jun 30, 2014

Re: Dynamic Control Plugin

Different Computers wrote:
isn't it "file" not "File"?

FYI you can drag and drop the target file to get the correct path, but as I recall you still have to put the right prefix in front of it.


I've tried all permutations of File, file etc. I believe I have the path correct (if you compare the pwd output and what I have in my file:// area

thanks

Posted on
Sat Dec 16, 2017 7:36 pm
DaveL17 offline
User avatar
Posts: 3497
Joined: Aug 20, 2013

Re: Dynamic Control Plugin

Try replacing the spaces with '%20':

Code: Select all
File:///Library/Application%20Support/Perceptive%20Automation/Indigo%207/IndigoWebServer/plugins/DynamicButton/testDynamicControl.png

URLs can't have spaces in them even though paths to files and folders can. With spaces, Indigo should still display the image on the control page even though it's (rightly) complaining about the URL construction.

Replace the spaces with %20; you'll get the image and no complaints from Indigo.

Posted on
Mon Dec 18, 2017 5:13 pm
tornado offline
User avatar
Posts: 61
Joined: Jun 30, 2014

Re: Dynamic Control Plugin

Thanks that worked. And for the record it did require me to use file:/// not File:///

Thanks!

Posted on
Mon Dec 18, 2017 5:17 pm
DaveL17 offline
User avatar
Posts: 3497
Joined: Aug 20, 2013

Re: Dynamic Control Plugin

Glad that worked for you. Sorry I didn’t spot the File vs file bit.


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest