Dynamic Control Plugin

Posted on
Mon Feb 13, 2017 12:56 am
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Dynamic Control Plugin

Download Here: https://github.com/bkmar1192/DynamicControl

The Dynamic Control plugin provides a means to create more dynamic buttons and images on control pages. You define a device that has image properties and you can adjust those properties by calling certain actions. These images can then be used as refreshing images on control pages (The images are currently only squares - future version may allow other shapes).

Dynamic Control used the Python Pillow library. You will need install by running the following: 'sudo pip install Pillow'

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

Posted on
Mon Feb 13, 2017 4:52 am
DaveL17 offline
User avatar
Posts: 3223
Joined: Aug 20, 2013

Re: Dynamic Control Plugin

Neat idea. I will definitely have to check this out. I especially like your thermostat example in the docs.

Posted on
Mon Feb 13, 2017 7:21 am
DaveL17 offline
User avatar
Posts: 3223
Joined: Aug 20, 2013

Re: Dynamic Control Plugin

This is a very cool plugin. I have my first test image working very well. For others, here are the steps I took:

Install Pillow:
You *may* need to install Pillow a little differently than the docs suggest. If you're having trouble, try:
Code: Select all
sudo -H pip install Pillow

Create a device:
I went through a couple iterations before I realized that a transparency level of zero is actually full transparency. I suggest starting with canvas and image transparency settings set to 255. Note to dev, I'd suggest default transparency settings of 255. :D

Screen Shot 2017-02-13 at 7.10.32 AM.png
device
Screen Shot 2017-02-13 at 7.10.32 AM.png (94.22 KiB) Viewed 1616 times

Create an Action:

Screen Shot 2017-02-13 at 7.10.55 AM.png
action
Screen Shot 2017-02-13 at 7.10.55 AM.png (48.35 KiB) Viewed 1616 times

Create a Trigger:
Create a trigger to change the image any time the variable changes.

Sample Image:
Dynamic_Button_1.png
button
Dynamic_Button_1.png (102 Bytes) Viewed 1616 times


This has great potential. Nice work!
Dave

Posted on
Sun Aug 13, 2017 7:48 pm
whmoorejr offline
User avatar
Posts: 167
Joined: Jan 15, 2013
Location: Houston, TX

Re: Dynamic Control Plugin

http:// or File:///

I think I have my first dynamic button made.... pillow, created device, created trigger.... not trying to get the image onto a page.

Display Refreshing Image URL

Tried: http://10.0.6.10:8176/plugins/DynamicButton/heat1.png (where "heat1" is the name of the device and I see "heat1.png" in that folder....

but I get the "?" crap.

8176 should point to everything within the IWS folder, right? Should I change the directory to IWS/Images ?

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

Beyond that... setting up was a breeze. Thank you very much for this plugin. I configured it a little bit differently. Since I have some devices that = activity that don't have build in delays, I added an initial action to clear out any scheduled delays for the trigger.... so if it gets an "activity" trigger during the fading process, it will just reset back to a solid color.

For the input, I'm using kmarkley's plugin, Timed Devices http://forums.indigodomo.com/viewtopic.php?t=18785

I've created an activity timer for each area to correspond with the heat map. This device turns on for a set amount of time based on the input of other devices (motion detector, door sensor, window sensor, light, fan, etc.) Once that device detects a changed state, it's timer resets.

For the Dynamic Control Plugin, the trigger for the same area is triggered off that Timed Device. "Reset Time", "Has Any Change". Every time an initiating device (motion, fan, light, door, etc) in the designated area does something, the timer is reset and your plugin trigger fires off.

Might sound confusing, but now I can have a graphical view (your plugin) and a data view (Timed Devices plugin).

For an extra layer of neediness... I'm also using EPS - Device Extensions plugin. As long as the timer is running, the EPS device shows "0". Once the Timed Device goes idle, the EPS device shows time since last updated (how long has it been idle). (Use device, (Select timed device), convert lastChanged (property), Convert Date/Time to Elapsed Minutes, Format %Y-%m-%d %H:%M:%S) http://forums.indigodomo.com/viewtopic.php?f=197&t=16233

Example use with all three: I can put the EPS number under the heat map image layer from your plugin.... so if an area has been quiet.... I can see for how long. Once the area goes active, the image from your plugin overlaps the "0" that the EPS device just reverted back to.

The display state of the timed device is black text on top of the heat image which will show a countdown that corresponds with the fading image.

Anyway... I just started to play with this.... I'm sure I will have it configured totally differently within a week.

Thanks again for a great plugin contribution!

Posted on
Tue Aug 15, 2017 7:27 am
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

whmoorejr wrote:
http:// or File:///

I think I have my first dynamic button made.... pillow, created device, created trigger.... not trying to get the image onto a page.

Display Refreshing Image URL

Tried: http://10.0.6.10:8176/plugins/DynamicButton/heat1.png (where "heat1" is the name of the device and I see "heat1.png" in that folder....

but I get the "?" crap.

8176 should point to everything within the IWS folder, right? Should I change the directory to IWS/Images ?

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


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


Sent from my iPhone using Tapatalk

Posted on
Tue Aug 15, 2017 7:50 am
Different Computers online
User avatar
Posts: 1204
Joined: Jan 02, 2016
Location: East Coast

Re: Dynamic Control Plugin

I've got some ideas of my own, but I'd love to hear others' examples of how they plan to use this plugin.

Refugee from SmartThings and so happy to be on Indigo now.
Sierra on an i5 running Harmony Hub, Hue, Security Camera, DomoPad, EPS Device Extensions EPS Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFiAP, Wunderground.

Posted on
Tue Aug 15, 2017 9:02 am
pocster offline
User avatar
Posts: 217
Joined: Nov 15, 2014

Re: Dynamic Control Plugin

Rotation would be nice.

So for example a 'speedo ' type pointer.

Also zoom in & out (so the shape can 'grow' or 'shrink'.

A texture on the shape.

Other shapes

Not fully used the plugin yet so just thinking aloud! 8)

Posted on
Tue Aug 15, 2017 7:37 pm
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

Different Computers wrote:
I've got some ideas of my own, but I'd love to hear others' examples of how they plan to use this plugin.


By the way, forgot to mention earlier, great idea on showing the timers - now I need to go update my control pages :)


Sent from my iPhone using Tapatalk

Posted on
Tue Aug 15, 2017 7:43 pm
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

I am planning to use it as a way to dynamically change the background color in my control pages. i.e. Red if my alarm is set, dark background at night, maybe different color background based on weather... Allow me to get quick info from my iPad across the room.


Sent from my iPhone using Tapatalk

Posted on
Tue Sep 12, 2017 12:57 pm
Sevilsivle offline
Posts: 63
Joined: Jan 11, 2013

Re: Dynamic Control Plugin

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
Wed Sep 13, 2017 3:32 pm
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

Have you tried sudo -H pip install Pillow? This sometimes helps ensure it gets installed to the correct directory.


Sent from my iPhone using Tapatalk

Posted on
Thu Sep 14, 2017 1:15 pm
Sevilsivle offline
Posts: 63
Joined: Jan 11, 2013

Re: Dynamic Control Plugin

Hi Bert,

yes this is how I installed Pillow

iMac:~ Tim$ sudo -H pip install Pillow
Password:
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)
iMac:~ Tim$

regards

Tim

Posted on
Sat Sep 16, 2017 3:38 pm
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

Where pip installs files may not be the same version of python as what Indigo is running. At a terminal type "which python". This should indicate which version of python is the default version.


Sent from my iPhone using Tapatalk

Posted on
Sat Sep 16, 2017 3:51 pm
Sevilsivle offline
Posts: 63
Joined: Jan 11, 2013

Re: Dynamic Control Plugin

Hi Bert,

it seems the Python version is 2.7 as expected.

tim$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python


Tim

Posted on
Sun Sep 17, 2017 8:47 pm
bkmar1192 offline
Posts: 247
Joined: Sep 12, 2015

Re: Dynamic Control Plugin

Ok - I remember having this problem before but don't exactly remember how I resolved it. Try sudo -H pip3 install Pillow.


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest