New Plugin: Control Indigo from Cisco Phones

Posted on
Tue Mar 23, 2010 5:41 am
Oliver offline
Posts: 4
Joined: Mar 16, 2010

New Plugin: Control Indigo from Cisco Phones

Hi Guys,

As I am running an Asterisk Phone PBX with a couple of Cisco SIP Phones attached, I hacked together a new plug-in to be able to control Indigo from the Phones. My girlfriend loves it, as its simple and she can control stuff from every phone.

If you don't know the Cisco IP Phones, they come in different flavors. The 7971GE has a color touch screen and runs about at US$200. Probably one of the cheapest HA Touchscreen controllers you can get considering that you get a great SIP phone thrown in ;-) There are also other model like the Cisco 7961GE at about US$100 with the same functionality minus the touchscreen and color.
7971GE.jpg
7971GE.jpg (5.52 KiB) Viewed 10581 times

Enough advertising for which I don;t even get paid :) Let's get to the plug in itself:

The main menu allows to go to the Devices or Actiongroup submenu.
mainmenu.png
mainmenu.png (17.74 KiB) Viewed 10581 times

For convenience, action groups whose name is prefixed with "cphone." (For example 'cphone.Turn on Lights') will show up in the main menu as well as some sort of shortcut to often used Devices, Actions.

The Device menu actually shows the state of the fixture or switch as well using the pre-installed graphics (Thanks Matt!)

To make this work, the Cisco Phone Config (SEPXXXXXX.xml.cnf) needs to have the INDIGO server URL configured:
For example:
"<servicesURL>http://indigo_server_ip:8176/CiscoServices/mainmenu</servicesURL>"

Otherwise this is all plug and play. I don't have HVAC or some of the other special devices, hence I am not sure how that works though.

Let me know if you have any questions or I would appreciate feedback or ideas on how to expand this.
I plan to add Image Maps soon, as that will allow custom touch sensitive background images a la Control Pages.
The code certainly is not the prettiest, as I have not really touched Python before this little project.

Here some additional screen shots from the phone display:
devices.png
devices.png (19.21 KiB) Viewed 10581 times
action.png
action.png (17.84 KiB) Viewed 10581 times


Code:
You can download the plugin here: http://www.perceptiveautomation.com/filelib/index.php?id=104
Just unzip and put into the plugin directory. The directory name needs to be "CiscoServices"

Not sure how to get this into the user contribution library. Any help appreciated.

Posted on
Tue Mar 23, 2010 9:08 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New Plugin: Control Indigo from Cisco Phones

At the top of the file library page there's a link to submit contributions. Then, once it's been approved, you can copy the link that's on the icon next to the entry for a direct link to your submission and paste it back in to your entry here to complete the cross-linking.

[EDIT] - and, thanks much for the contribution, that's fantastic!!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Mar 23, 2010 7:42 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: New Plugin: Control Indigo from Cisco Phones

Very cool! Thanks for sharing.

Image

Posted on
Fri May 07, 2010 9:21 pm
imath offline
Posts: 4
Joined: May 07, 2010

Re: New Plugin: Control Indigo from Cisco Phones

Dear Olivier,
Excellent work..
I was looking for something else and found your post, I just acquired couple of ip phone and was thinking to make same kind of integration :)

I would like to help, as I have compatibility issue and limitations with current code and would like to make it work ;)

-One of my phone is BW, therefore the menu tags CiscoIPPhoneIconFileMenu using color png files, prevents the page from opening.. In this case, page should use the CiscoIPPhoneMenu with BW CIP images..
>> could get/handle the x-CiscoIPPhoneModelName or the x-CiscoIPPhoneDisplay headers values to make an smart selection ?

-When selecting a device to update his status the page refreshes very quickly.. so the icon/status is not yet updated..
>> I suppose It could be possible to delay a little bit the resulting page / set an refresh header / add the refresh softKey /..

(edit: I just saw your other post on this issue...I suppose your delay solution isn't coded in this version ?)

-Pages could use SoftKeys to make some home/exit/refresh links..
>> for instance a home link in the device page, so it is possible to get directly to the home after several device updates without making the whole path back (I know there are links at the end of the menu to do so but I find softkeys more convenient :D)

These elements are based on my early testings on SPA502G and SPA525G.. maybe some 'issues' are specific to my devices/FW ..

don't hesitate to contact me.. :D

kind regards,
Mathieu
Last edited by imath on Sat May 08, 2010 9:36 am, edited 1 time in total.

Posted on
Sat May 08, 2010 9:18 am
imath offline
Posts: 4
Joined: May 07, 2010

Re: New Plugin: Control Indigo from Cisco Phones

Hi,
I implemented the softkey usage in the code.. :wink:
As currently contextual softkeys are not useful, I just added the following line at the end of mainmenu.html - just before the "</CiscoIPPhoneIconFileMenu>"

Code: Select all
     <SoftKeyItem>
        <Name>Main</Name>
        <URL>$baseurl/CiscoServices/mainmenu?view=main</URL>
        <Position>1</Position>
     </SoftKeyItem>
     <SoftKeyItem>
        <Name>Devices</Name>
        <URL>$baseurl/CiscoServices/mainmenu?view=device</URL>
        <Position>2</Position>
     </SoftKeyItem>
     <SoftKeyItem>
        <Name>ActionGrp</Name>
        <URL>$baseurl/CiscoServices/mainmenu?view=actiongroup</URL>
        <Position>3</Position>
     </SoftKeyItem>
     <SoftKeyItem>
      <Name>Exit</Name>
      <URL>Key:Services</URL>
      <Position>4</Position>
    </SoftKeyItem>


I didn't put the Select item as it is currently not useful (can select with the center of directionnal pad) , but as some other phones don't have this hardware button , it will certainly be a problem.. :cry:
('ll be necessary to change it later..)

The Exit Softkey (Key:Services) is a bit tricky as my previous testing showed it won't work on the 502G ; on the other hand the Key:Exit softkey acts like 'back' in most cases...what I definitely don't want.. (It seems the Exit could work by playing with the Expire value of the previous pages...)
Last edited by imath on Sun May 09, 2010 6:59 pm, edited 2 times in total.

Posted on
Sat May 08, 2010 9:45 am
imath offline
Posts: 4
Joined: May 07, 2010

Re: New Plugin: Control Indigo from Cisco Phones

In case someone wants to make an easier link to the webpage, it is possible to use one of the device unused lineKey (the hardware buttons on the right of the screen..)

You have to disable the extension on the key , change the short Name and type the following link in the 'Extended Function' field

Code: Select all
fnc=xml;url=http://indigo_server_ip:8176/CiscoServices/mainmenu

Posted on
Sat May 08, 2010 10:41 am
imath offline
Posts: 4
Joined: May 07, 2010

Re: New Plugin: Control Indigo from Cisco Phones

Dear Olivier,
It seems cphone.x shortcuts works only for action groups..
In my case I needed the same mechanics but for devices.. I therefore added the following code in the "Show Shortcuts" section of the mainmenu.html

Code: Select all
#for $dev in $devList
     #if not $string.find($dev.name,"cphone.")
     <MenuItem>
        #if $dev.typeSupportsOnOff
         #if $dev.isOn
            #if $dev.typeSupportsDim
            <Name>$string.lstrip($dev.name,"cphone.") ($dev.brightness%)</Name>
            <URL>$baseurl/CiscoServices/mainmenu?action=turnoff&amp;device=$dev.name&amp;view=$view</URL>
            <IconIndex>0</IconIndex>
            #else
            <Name>$string.lstrip($dev.name,"cphone.") (On)</Name>
            <URL>$baseurl/CiscoServices/mainmenu?action=turnoff&amp;device=$dev.name&amp;view=$view</URL>
            <IconIndex>0</IconIndex>
            #end if
            
         #else
         <Name>$string.lstrip($dev.name,"cphone.") (Off)</Name>
         <URL>$baseurl/CiscoServices/mainmenu?action=turnon&amp;device=$dev.name&amp;view=$view</URL>
         <IconIndex>1</IconIndex>
         #end if
        #end if
     </MenuItem>
     #end if
   #end for

Posted on
Thu May 13, 2010 8:38 pm
xjosh offline
Posts: 5
Joined: May 12, 2010

Re: New Plugin: Control Indigo from Cisco Phones

Hi,

Nice work! This seems to work well in initial testing on my 7961G's (running SCCP on PIAF). One bug I caught, though. The entries in the device menu are not URL escaped, and this was causing XML errors on my devices with spaces in the names. A quick update to that section (using $urllib.quote()) in the mainmenu.html fixed that for me:

Code: Select all
###############################################################################
## Device View
##

#if $view == "device"
        #for $dev in $devList
          #if not $dev.hasStateToDisplay or not $dev.displayInUI
                #continue
          #end if
          <MenuItem>
                  #if $dev.typeSupportsOnOff
                        #if $dev.isOn
                                #if $dev.typeSupportsDim
                                <Name>$dev.name ($dev.brightness%)</Name>
                                <URL>$baseurl/CiscoServices/mainmenu?action=turnoff&amp;device=$urllib.quote($dev.name)&amp;view=$view</URL>
                                <IconIndex>0</IconIndex>
                                #else
                                <Name>$dev.name (On)</Name>
                                <URL>$baseurl/CiscoServices/mainmenu?action=turnoff&amp;device=$urllib.quote($dev.name)&amp;view=$view</URL>
                                <IconIndex>0</IconIndex>
                                #end if

                        #else
                        <Name>$dev.name (Off)</Name>
                        <URL>$baseurl/CiscoServices/mainmenu?action=turnon&amp;device=$urllib.quote($dev.name)&amp;view=$view</URL>
                        <IconIndex>1</IconIndex>
                        #end if
                  #end if
          </MenuItem>
        #end for
        <MenuItem>
                <Name>Back to Mainmenu</Name>
                <URL>$baseurl/CiscoServices/mainmenu?view=main</URL>
        </MenuItem>
#end if


Thanks,
Josh

Posted on
Tue Dec 13, 2011 12:29 pm
KittNetComputing offline
Posts: 1
Joined: Dec 13, 2011

Re: New Plugin: Control Indigo from Cisco Phones

Sorry to re-kindle an old thread but I have a few of the Cisco 7970 IP Phones that I converted to SIP and have been using with Asterisk. I just recently started filling the house with Insteon switches and have been using Indigo 5 to control everything. So far I absolutely love it! Now I think it would be amazing to integrate the IP phones into the mix as wall mounted touch screens since I already have them mounted in several of the rooms as intercoms. Is this plugin compatible with Indigo 5? Otherwise I've got a few Xserves in the mix and could potentially setup some sort of an XML page hosted by one of the web servers that would show on the Cisco phones with buttons correlating to url links for device control in Indigo. I'm not sure if I am thinking along the right lines though, and any help would be much appreciated.

Thanks for all your help,
-Alex

Posted on
Tue Nov 12, 2013 12:08 pm
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Re: New Plugin: Control Indigo from Cisco Phones

I would like to second the request above for compatibility. As the contribution page states "indigo 4.x only" I'm wondering if it's compatible with version 6.

Posted on
Tue Nov 12, 2013 12:14 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: New Plugin: Control Indigo from Cisco Phones

I don't know of any reason why it wouldn't work, so I would suggest giving it a try. Note it is an IndigoWebServer plugin, which is unrelated to the newer (Indigo v5 and v6) plugins. The correct folder to copy it into would be:

/Library/Application Support/Perceptive Automation/Indigo 6/IndigoWebServer/plugins/

Image

Posted on
Tue Nov 12, 2013 1:53 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: New Plugin: Control Indigo from Cisco Phones

matt (support) wrote:
I don't know of any reason why it wouldn't work, so I would suggest giving it a try. Note it is an IndigoWebServer plugin, which is unrelated to the newer (Indigo v5 and v6) plugins. The correct folder to copy it into would be:

/Library/Application Support/Perceptive Automation/Indigo 6/IndigoWebServer/plugins/


I had it working a few of months ago when i was playing around with a cisco phone (in Indigo 6 Beta 9 if i recall correctly) and didn’t have any issues.

Computer says no.

Posted on
Wed Nov 13, 2013 10:00 am
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Re: New Plugin: Control Indigo from Cisco Phones

Thanks guys. I'm getting an "undefined page requested" when I go to http://indigo_server_ip:8176/CiscoServices/mainmenu from a web browser. I probably missed something. Any thoughts?

I've got the files loaded in the directory Jay suggested (web plugins).

Posted on
Thu Nov 14, 2013 7:09 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: New Plugin: Control Indigo from Cisco Phones

Did you stop and restart the Indigo Server after you copied the file over?

If that doesn't help, then copy/paste the Event Log contents after the restart into a reply. It might show some errors related to the plugin.

Image

Posted on
Thu Nov 14, 2013 9:55 am
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Re: New Plugin: Control Indigo from Cisco Phones

Stopping and restarting did not seem to work for me. I tried a reboot today and I think it's working. The page is a bunch of XML text, which I expect gets handled by the phone.

Who is online

Users browsing this forum: No registered users and 1 guest