Masquerade Plugin

Posted on
Sun Dec 04, 2016 3:40 pm
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Masquerade Plugin

This plugin allows non-sensor devices (IOLincs, Alarm zones, etc) look like Sensor devices. Useful for the MyQ plugin, if nothing else.

https://github.com/FlyingDiver/Indigo-M ... tag/v0.0.2

Basically, this does (in a limited way) what the Virtual Device plugin does. Without having to create variables and scripts.

I will be adding the relay and lock device masquerading in the future. User requests for enhancements welcome.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 11:59 am
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Added a Dimmer type device: https://github.com/FlyingDiver/Indigo-M ... e/releases

This one is a little more involved to set up, because it's two way. The Sensor device just watches a specified state in the underlying device, and sets the onOffState of the masquerade device appropriately.

For the dimmer device, in addition to knowing the target device state that contains the value you're trying to masquerade, you also need an available action in the underlying device that will set that state. And you need to know the ConfigUI Field used by that action. For example, if you wanted to masquerade an Airfoil Speaker's volume setting as a dimmer device, so it could be commanded from Siri or Alexa, you would look at the Actions.xml file inside the Airfoil Pro plugin. In there, you would see:

Code: Select all
   <Action id="setVolume" deviceFilter="self.speaker" uiPath="DeviceActions">
      <Name>Set Volume</Name>
      <CallbackMethod>setVolume</CallbackMethod>
      <ConfigUI>
         <Field id="volume" type="textfield" defaultValue="50">
            <Label>Enter New Volume:</Label>
            <Description>Enter a value from 0 to 100</Description>
         </Field>
         <Field id="description" type="textfield" hidden="true">
            <Label></Label>
         </Field>
      </ConfigUI>
   </Action>


So the Action needed is "setVolume", and the Field used to pass the new setting is "volume". When you go to set these in the Masquerade plugin's device configuration dialog, it'll actually show the Name field for the action - "Set Volume". The Field section doesn't have a name, so it shows the "id".

Attached is the screen shot of the device configuration dialog for an Airfoil Pro speaker.
Attachments
Screen Shot 2016-12-13 at 12.47.13 PM 12-13.png
Screen Shot 2016-12-13 at 12.47.13 PM 12-13.png (232.37 KiB) Viewed 3358 times

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 12:59 pm
jay (support) offline
Site Admin
User avatar
Posts: 15153
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Masquerade Plugin

Sweet!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Dec 13, 2016 1:10 pm
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

jay (support) wrote:
Sweet!


Parsing the Actions.xml file to get the Actions and Fields for setting the value was fun. ;)

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 2:52 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

Hi
just trying to set up a volume dimmer device but when i choose plugin there are no plugins listed.
I can see zwave devices but no plugins.
any ideas?

thanks

Keith

Posted on
Tue Dec 13, 2016 3:38 pm
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Ksullivan wrote:
Hi
just trying to set up a volume dimmer device but when i choose plugin there are no plugins listed.
I can see zwave devices but no plugins.
any ideas?

thanks

Keith


That's very odd. You should be creating a Masquerade Dimmer device, then selecting Plugin for Device Class. The next popup doesn't have a list of plugins?

You're running Indigo 7? What's the path to your Indigo install? Your plugins are in "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins"?

I took all the debug messages out of those routines because I thought they were done. Maybe I need to put them back in. If you turn on debug logging, is there anything in the Indigo log?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 3:40 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

Yes I'm using Indigo 7 and the plugins are in the Indigo 7 folder


Sent from my iPad using Tapatalk

Posted on
Tue Dec 13, 2016 3:43 pm
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Can you open a terminal window, cd to the Indigo 7 directory, then do an "ls -la Plugins"?

Code: Select all
$ cd "/Library/Application Support/Perceptive Automation/Indigo 7"
$ ls -la Plugins


Thanks!

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 3:44 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

Is this any help


Sent from my iPad using Tapatalk

Posted on
Tue Dec 13, 2016 3:51 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

Just logging on to Mac to check


Sent from my iPad using Tapatalk

Posted on
Tue Dec 13, 2016 3:55 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

From terminal
total 56
drwxrwxr-x 37 keithsullivan admin 1258 13 Dec 20:37 .
drwxrwxr-x 12 keithsullivan admin 408 13 Dec 20:45 ..
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 .Action Collection.indigoPlugin
-rw-r--r--@ 1 keithsullivan admin 18436 13 Dec 21:28 .DS_Store
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 .Z-Wave.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 19 Oct 2014 Airfoil.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 26 Jun 2012 Announcer.indigoPlugin
drwxr-xr-x 7 keithsullivan admin 238 10 May 2015 Contents
drwxr-xr-x 3 keithsullivan admin 102 24 Apr 2016 Cynical Behaviors.indigoPlugin
drwxr-xr-x 3 keithsullivan admin 102 29 Dec 2014 Cynical Weather.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 4 Mar 2014 EPS Device Extensions.indigoPlugin
drwxr-xr-x@ 3 keithsullivan staff 102 4 Dec 14:17 EPS Homebridge.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 4 Mar 2014 EPS Scene Toggle.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 4 Mar 2014 EPS Security Manager.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 EasyDAQ USB Relay Cards.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 Global Property Manager.indigoPlugin
drwxrwxr-x@ 3 keithsullivan admin 102 19 Nov 2011 Group-Trigger-9.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 Growl.indigoPlugin
drwxr-xr-x 4 keithsullivan admin 136 5 Apr 2016 INDIGOplotD.indigoPlugin
drwxrwxrwx 3 keithsullivan admin 102 15 Oct 2013 Indigo Backup.indigoPlugin
-rw------- 1 keithsullivan admin 809 16 May 2014 Info.plist
drwxr-xr-x@ 3 keithsullivan admin 102 9 Aug 2015 JRiver.indigoPlugin
drwxr-xr-x 3 keithsullivan admin 102 2 Jun 2015 Mac System.indigoPlugin
drwxr-xr-x@ 3 keithsullivan staff 102 13 Dec 09:56 Masquerade.indigoPlugin
drwxr-xr-x@ 5 keithsullivan admin 170 9 Nov 22:02 NEST Home.indigoPlugin
drwx------@ 3 keithsullivan admin 102 3 Sep 2012 RFXCOM.indigoPlugin
-rw-r--r--@ 1 keithsullivan admin 2949 27 Jun 2015 RGBColours.txt
drwxr-xr-x@ 3 keithsullivan admin 102 18 Dec 2011 Russound.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 7 Oct 2014 SmartDevices.indigoPlugin
drwxr-xr-x 3 keithsullivan admin 102 15 Oct 2014 Stella-Z.indigoPlugin
drwxrwxrwx@ 4 keithsullivan admin 136 26 Nov 2012 Switchboard.indigoPlugin
drwxr-xr-x 3 keithsullivan admin 102 4 Apr 2016 Temperature Scale Adapter.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 Timers and Pesters.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 Virtual Devices.indigoPlugin
drwxr-xr-x@ 3 keithsullivan admin 102 26 Aug 2012 apcupsd.indigoPlugin
drwxrwxr-x 3 keithsullivan admin 102 24 Nov 00:08 iTunes.indigoPlugin
drwxr-xr-x@ 5 keithsullivan admin 170 13 Mar 2016 indigo-pushover.indigoPlugin

Posted on
Tue Dec 13, 2016 4:01 pm
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Ok, that tells me I need to trap any errors trying to read the plist and skip that item. I'll do that.

In the meantime, you've got some files in that directory that really shouldn't be there. There shouldn't be anything in there except plugins ended in .indigoPlugin. So you might want to get rid of these files:

Code: Select all
drwxr-xr-x 7 keithsullivan admin 238 10 May 2015 Contents
-rw------- 1 keithsullivan admin 809 16 May 2014 Info.plist
-rw-r--r--@ 1 keithsullivan admin 2949 27 Jun 2015 RGBColours.txt


You could delete the .DS_Store file, but it'll just reappear later.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 4:04 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

Thanks Joe

Posted on
Tue Dec 13, 2016 4:13 pm
FlyingDiver offline
Posts: 2750
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin


joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 13, 2016 4:30 pm
Ksullivan offline
Posts: 63
Joined: Feb 22, 2014

Re: Masquerade Plugin

That got it I'm using it to control the volume on the russound plugin and works a treat. Now to try Siri
Thanks Joe


Sent from my iPad using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest