Masquerade Plugin

Posted on
Wed Dec 14, 2016 1:50 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Well, here's the problem:
Code: Select all
   <Action id="actionSetZoneVolume" deviceFilter="self.russoundZone">
      <Name>Set Zone Volume Level</Name>
      <CallbackMethod>actionSetZoneVolume</CallbackMethod>
      <ConfigUI>       
         <Field id="setting" type="menu">
            <Label>Volume Level:</Label>
            <List class="self" method="getVolumeList"/>
         </Field>
      </ConfigUI>      
   </Action>

The "setting" field isn't a simple text field. It's a popup menu. Which is populated by:
Code: Select all
   def getVolumeList(self):
      array = []
      for i in range(0, 51):
         array.append((self.dec2hex(i), i * 2))
         i =+ 1
      return array

So the actual value that needs to be sent to the Russound is a hex value, not a decimal value. Like:
Code: Select all
0 -> 00
1 -> 01
10 -> 0A
11 -> 0B
20 -> 14
32 -> 20
and so on

It looks like the popup for the set volume action will have values 0 to 100 by 2s, is that right? I'm looking at the code, but I have not installed the plugin to create any devices.

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

Posted on
Wed Dec 14, 2016 2:03 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

I set up a quick action using the Russound plugin and setting the volume to 24 (the volume will go to 100 but i dont usually go past 30ish)

Code: Select all
Action Group                    Russond Zone 1 Volume 24
   Russound Debug                  TX: F0 00 00 7F 00 00 70 05 02 02 00 00 F1 21 00 0C 00 00 00 01 1B F7
   Russound Debug                  RX: F0 00 00 7D 00 00 7F 06 0C 00 F1 6F 01 10 7D F7
   Russound Debug                      Target Controller: 00
   Russound Debug                      Target Zone:       00
   Russound Debug                      Target Keypad:     7D
   Russound Debug                      Source Controller: 00
   Russound Debug                      Source Zone:       00
   Russound Debug                      Source Keypad:     7F
   Russound Debug                      Message Type ID:   06 Rendered Display
   Russound Debug                      Render Type:       10 Volume
   Russound Debug                      Value Low Byte:    0C
   Russound Debug                      Value High Byte:   00
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 24
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 24, scaled = 24
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (24) --> Masquerade Zone 1 (24)

Posted on
Wed Dec 14, 2016 2:04 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

Sorry

Yes it is does go up in 2's

Posted on
Wed Dec 14, 2016 3:50 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

I'm trying to figure out a way to get around this issue without adding special case code to the plugin.

When you look at the states for "Russound Zone 1", what's in the "Volume" state? What are the high and low values, and are they decimal or hex? Post the value you set and what the State is set to for a range of settings.

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

Posted on
Wed Dec 14, 2016 6:12 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

Looks like you are right on the hex i think Low Byte is the Vol

Code: Select all
Action Group                    Russond Zone 1 Volume 32
   Russound Debug                  TX: F0 00 00 7F 00 00 70 05 02 02 00 00 F1 21 00 10 00 00 00 01 1F F7
   Russound Debug                  RX: F0 00 00 7D 00 00 7F 06 10 00 F1 6F 01 10 01 F7
   Russound Debug                      Target Controller: 00
   Russound Debug                      Target Zone:       00
   Russound Debug                      Target Keypad:     7D
   Russound Debug                      Source Controller: 00
   Russound Debug                      Source Zone:       00
   Russound Debug                      Source Keypad:     7F
   Russound Debug                      Message Type ID:   06 Rendered Display
   Russound Debug                      Render Type:       10 Volume
   Russound Debug                      Value Low Byte:    10
   Russound Debug                      Value High Byte:   00
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 32
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 32, scaled = 32
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (32) --> Masquerade Zone 1 (32)
 
Action Group                    Russond Zone 1 Volume 10
   Russound Debug                  TX: F0 00 00 7F 00 00 70 05 02 02 00 00 F1 21 00 05 00 00 00 01 14 F7
   Russound Debug                  RX: F0 00 00 7D 00 00 7F 06 05 00 F1 6F 01 10 76 F7
   Russound Debug                      Target Controller: 00
   Russound Debug                      Target Zone:       00
   Russound Debug                      Target Keypad:     7D
   Russound Debug                      Source Controller: 00
   Russound Debug                      Source Zone:       00
   Russound Debug                      Source Keypad:     7F
   Russound Debug                      Message Type ID:   06 Rendered Display
   Russound Debug                      Render Type:       10 Volume
   Russound Debug                      Value Low Byte:    05
   Russound Debug                      Value High Byte:   00
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 10
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 10, scaled = 10
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (10) --> Masquerade Zone 1 (10)


 Action Group                    Russond Zone 1 Volume 14
   Russound Debug                  TX: F0 00 00 7F 00 00 70 05 02 02 00 00 F1 21 00 07 00 00 00 01 16 F7
   Russound Debug                  RX: F0 00 00 7D 00 00 7F 06 07 00 F1 6F 01 10 78 F7
   Russound Debug                      Target Controller: 00
   Russound Debug                      Target Zone:       00
   Russound Debug                      Target Keypad:     7D
   Russound Debug                      Source Controller: 00
   Russound Debug                      Source Zone:       00
   Russound Debug                      Source Keypad:     7F
   Russound Debug                      Message Type ID:   06 Rendered Display
   Russound Debug                      Render Type:       10 Volume
   Russound Debug                      Value Low Byte:    07
   Russound Debug                      Value High Byte:   00
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 14
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 14, scaled = 14
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (14) --> Masquerade Zone 1 (14)

Posted on
Wed Dec 14, 2016 6:59 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

I still need to know what's in the "Volume" state. Is it the hex value, or does the plugin covert it to an integer?

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

Posted on
Thu Dec 15, 2016 1:20 am
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

The volume state shows the dec figureImage


Sent from my iPad using Tapatalk

Posted on
Thu Dec 15, 2016 5:22 am
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Did you set the volume to 20? 20 could be hex. Try a couple different volume settings and report what the state shows. Preferably with the text from the Indigo log.

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

Posted on
Thu Dec 15, 2016 11:59 am
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Nevermind. I looked at the Russound plugin code to see what it's doing.

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

You're going to need to set up the Device configuration very carefully for this to work. It's going to look like this:

Screen Shot 2016-12-15 at 12.56.01 PM 12-15.png
Screen Shot 2016-12-15 at 12.56.01 PM 12-15.png (358.52 KiB) Viewed 7310 times


The state scaling is 0-100, because that's the range of the Volume state variable.

The action scaling is 0-50, because that's the actual range the device accepts, even though the set volume pop-up is showing 0-100. It's lying.

And the action expects that value to be Hex, so that's the last popup. I forgot to change the label on that one, it'll be fixed in the next release.

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

Posted on
Thu Dec 15, 2016 2:22 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

Hi Joe

I have set up exactly as you said but the logic doesn't seem to be working

Amend the dimmer to 78 this is the debug
Code: Select all
   Masquerade Debug                scaleMasqToBase: lowLimit = 0, highLimit = 50, reverse = False, input = 79, format = Hexidecimal, scaled = 27
   Masquerade Debug                actionControlDevice: "Living Room Music" Set Brightness to 79 (scaled = 27)
   Russound Debug                  TX: F0 00 00 7F 00 00 70 05 02 02 00 00 F1 21 00 27 00 00 00 01 36 F7
   Russound Debug                  RX: F0 00 00 7D 00 00 7F 06 27 00 F1 6F 01 10 18 F7
   Russound Debug                      Target Controller: 00
   Russound Debug                      Target Zone:       00
   Russound Debug                      Target Keypad:     7D
   Russound Debug                      Source Controller: 00
   Russound Debug                      Source Zone:       00
   Russound Debug                      Source Keypad:     7F
   Russound Debug                      Message Type ID:   06 Rendered Display
   Russound Debug                      Render Type:       10 Volume
   Russound Debug                      Value Low Byte:    27
   Russound Debug                      Value High Byte:   00
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 78
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 78, scaled = 78
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (78) --> Living Room Music (78)

Slider set to 50

Code: Select all
   Masquerade Debug                scaleMasqToBase: lowLimit = 0, highLimit = 50, reverse = False, input = 51, format = Hexidecimal, scaled = 19
   Masquerade Debug                actionControlDevice: "Living Room Music" Set Brightness to 51 (scaled = 19)
   Russound Debug                  TX: F0 00 00 7F 00 00 70 05 02 02 00 00 F1 21 00 19 00 00 00 01 28 F7
   Russound Debug                  RX: F0 00 00 7D 00 00 7F 06 19 00 F1 6F 01 10 0A F7
   Russound Debug                      Target Controller: 00
   Russound Debug                      Target Zone:       00
   Russound Debug                      Target Keypad:     7D
   Russound Debug                      Source Controller: 00
   Russound Debug                      Source Zone:       00
   Russound Debug                      Source Keypad:     7F
   Russound Debug                      Message Type ID:   06 Rendered Display
   Russound Debug                      Render Type:       10 Volume
   Russound Debug                      Value Low Byte:    19
   Russound Debug                      Value High Byte:   00
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 50
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 50, scaled = 50
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (50) --> Living Room Music (50)

Setting the plugin to 54

Code: Select all
   Russound Debug                      Updating Device: Russound Zone 1, State: Volume, Value: 54
   Masquerade Debug                scaleBaseToMasq: lowLimit = 0, highLimit = 100, reverse = False, input = 54, scaled = 54
   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (54) --> Living Room Music (54)

So the scaling isn't working but all else seems ok if i now amend the scaling on both to 100

Now set dimmer to 57 and this happens and the dimmer shows 28

Code: Select all
   Masquerade Debug                validateDeviceConfigUi, typeID = masqDimmer
   Masquerade Debug                scaleMasqToBase: lowLimit = 0, highLimit = 100, reverse = False, input = 57, format = Hexidecimal, scaled = 39
   Masquerade Debug                actionControlDevice: "Living Room Music" Set Brightness to 57 (scaled = 39)

So it looks like the Hex is working but the dimmer scaling in not, could it be that the top value is also using Hex?

Sorry for your trouble :cry:

Posted on
Thu Dec 15, 2016 2:38 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

I don't get it. All of those look exactly correct except for the last one where you changed the scaling. You should not be looking at the scaled number in the debug output. That's the internal value passed to the Russound plugin, and it's actually a hex number. You just didn't happen to set it to any values where the output would obviously be hex.

In all three tests, the number you set the slider to on the Masquerade device is the same as the number reported by the Russound plugin after the update:
Code: Select all
   Masquerade Debug                actionControlDevice: "Living Room Music" Set Brightness to 79 (scaled = 27)

   Masquerade Debug                dimmerDeviceUpdate: Russound Zone 1 (78) --> Living Room Music (78)


If you attempt to put in an odd number from the slider (or any other method) it's going to get rounded down because the device actually only has a range of 50 (not 100).

So what are you expecting to see different?

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

Posted on
Thu Dec 15, 2016 2:53 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

Hi Joe

What I'm expecting is that 100% on the slider would equal a 50 on the russound state as 50 would be the max volume


Sent from my iPad using Tapatalk

Posted on
Thu Dec 15, 2016 2:56 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Ksullivan wrote:
Hi Joe

What I'm expecting is that 100% on the slider would equal a 50 on the russound state as 50 would be the max volume


Sent from my iPad using Tapatalk


Nope. The Russound plugin scales that value to 100. Try setting max value using the Russound Plugin action and see what you get.

Which is why back in viewtopic.php?f=216&t=17402&p=130749#p130653 I asked you to post the values of that state after setting various volume settings. You didn't, so I looked at the code to see what it was doing.

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

Posted on
Thu Dec 15, 2016 3:20 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Masquerade Plugin

Your right the russound plugin will go to 100 but that almost blows your speakers so I was hoping that we could restrict it so that maximum on the slider (100%) would equal 50 on the volume state. This is what i assumed the scale section would do


Sent from my iPad using Tapatalk

Posted on
Thu Dec 15, 2016 3:35 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Masquerade Plugin

Ksullivan wrote:
Your right the russound plugin will go to 100 but that almost blows your speakers so I was hoping that we could restrict it so that maximum on the slider (100%) would equal 50 on the volume state. This is what i assumed the scale section would do


No, the scaling is to match the dimmer range (0-100) to the underlying device range. Limiting the range is out of scope for the plugin. You'll need to do that in your control pages or some such.

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

Page 3 of 8 1, 2, 3, 4, 5, 6 ... 8

Who is online

Users browsing this forum: No registered users and 3 guests