Masquerade Plugin

User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Masquerade Plugin

Post by FlyingDiver »

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
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Masquerade Plugin

Post by FlyingDiver »

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 13539 times
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
jay (support)
Site Admin
Posts: 19202
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Masquerade Plugin

Post by jay (support) »

Sweet!
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Masquerade Plugin

Post by FlyingDiver »

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
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

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
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Masquerade Plugin

Post by FlyingDiver »

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
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

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


Sent from my iPad using Tapatalk
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Masquerade Plugin

Post by FlyingDiver »

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
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

Is this any help


Sent from my iPad using Tapatalk
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

Just logging on to Mac to check


Sent from my iPad using Tapatalk
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

From terminal

Code: Select all

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
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Masquerade Plugin

Post by FlyingDiver »

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
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

Thanks Joe
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Masquerade Plugin

Post by FlyingDiver »

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Ksullivan
Posts: 83
Joined: Sat Feb 22, 2014 5:02 pm

Re: Masquerade Plugin

Post by Ksullivan »

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
Post Reply

Return to “Other Plugins”