Author Topic: Off before On  (Read 5049 times)

0 Members and 1 Guest are viewing this topic.

Foggy

  • $upporter
  • Contributor
  • *****
  • Posts: 86
  • Karma: 4
    • View Profile
Off before On
« on: October 21, 2014, 09:45:54 AM »
Hi all,

VC 2.1.0.3
VoxCommandoSP


Amulet.On => Reduce the volume of my AVR using USB.Send
Amulet.Off => Raise the volume of my AVR using USB.Send

This works.

However I notice that when you lift the amulet it creates a Amulet.Off before it creates a Amulet.On

This causes the above to raise the volume and then reduce it and then raises it again when put back on the table.

Can anyone suggest what I might be doing wrong or how I might change the behaviour?

Best wishes.

James.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Off before On
« Reply #1 on: October 21, 2014, 11:12:42 AM »

However I notice that when you lift the amulet it creates a Amulet.Off before it creates a Amulet.On

This seems to happen when the Amulet has been idle long enough to disconnect, and then when it reconnects it generates the off message.  I guess it is something I can (should, will) "fix".  It has never been an issue for me because I only use softmute/softunmute.  It is a problem for you because you are using a more volatile setup, in which you adjust the volume of your receiver no matter what.  Normally, if you execute a SoftUnmute when the SoftMute has not been engaged then nothing will happen.

A fix you could do yourself (until I update the Amulet USB Monitor) would be to keep track of whether or not you have engaged a mute (using a variable and a logic block), and only "unmute" your receiver when necessary.

One thing I notice from your log is that you have the Amulet events assigned to multiple commands that do similar things.  You should remove the event from your regular VC listen/standby commands since you have created new commands to handle the events.

Foggy

  • $upporter
  • Contributor
  • *****
  • Posts: 86
  • Karma: 4
    • View Profile
Re: Off before On
« Reply #2 on: October 21, 2014, 02:12:01 PM »
Thank you.

I look forward to your fix.

I'll certainly remove the other events.

Regarding creating a variable. I think I understand what you are describing. Not sure I know how to do it though. Could you point me to any examples that I could study?

Best wishes.


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Off before On
« Reply #3 on: October 21, 2014, 04:03:06 PM »
The following should work. (You can delete my OSD messages. They're just for demonstration/testing purposes.)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.5-->
<commandGroup open="True" name="amulet events" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="219" name="Amulet On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>UsbUIRT.Send</cmdType>
      <params>
        <param>F41R0800815780AC1615164016151615164016151640164016401615164016401615164016401615164016401615161516151615161516151615161516401640164016401640164016</param>
        <param>1</param>
      </params>
      <cmdRepeat>5</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.SoftMute</cmdType>
      <params>
        <param>10</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>mute</param>
        <param>True</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>muting volume</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.On</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Amulet.On</event>
  </command>
  <command id="150" name="Amulet Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.mute}&amp;&amp;True</ifParams>
      <then>
        <action>
          <cmdType>VC.Off</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>UsbUIRT.Send</cmdType>
          <params>
            <param>F41R0800815680AC1615164016151615164016151640164016401615164016401615164016401615161516401615161516151615161516151640161516401640164016401640164016</param>
            <param>1</param>
          </params>
          <cmdRepeat>5</cmdRepeat>
        </action>
        <action>
          <cmdType>XJson.SoftUnMute</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>mute</param>
            <param>False</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>unmuting volume</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Ignoring Amulet Off event. Volume is already unmuted.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Amulet.Off</event>
  </command>
</commandGroup>

A couple examples on the forum come to mind, if you're interested, but they're more "high concept" than what's needed here.
http://voxcommando.com/forum/index.php?topic=1442.0
http://voxcommando.com/forum/index.php?topic=1679.msg14607#msg14607
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Off before On
« Reply #4 on: October 21, 2014, 05:30:10 PM »
Try this and please let us know how it works for you.

I've also added the ability to target a specific IP instead of doing a broadcast to all machines, because we've had issues when multiple versions of VC were running on the network on different machines.

If it seems to work OK I'll add this to the official "extras" on the download page.

The latest version has been updated in the "Extras" zip found here: http://voxcommando.com/downloads.asp
« Last Edit: October 22, 2014, 12:03:53 PM by jitterjames »

Foggy

  • $upporter
  • Contributor
  • *****
  • Posts: 86
  • Karma: 4
    • View Profile
Re: Off before On
« Reply #5 on: October 22, 2014, 06:51:37 AM »
Thank you jitterjames. The new .exe works well. You may want to change the version number.

nime5ter. Thank you also for your example. I can see this being very powerful. Now I know what to look for, I can re-visit the wiki.

Best wishes.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Off before On
« Reply #6 on: October 22, 2014, 08:18:38 AM »
Thanks.  I already did increase the version from 1.3.0.0 to 1.3.1.0

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Off before On
« Reply #7 on: October 22, 2014, 09:01:12 AM »
Oh I see it says on the form that it is version 1.1
I will fix.

I did not even realize that was there...  :bonk

To see the actual version you can right click on the .exe and select "properties". 

Foggy

  • $upporter
  • Contributor
  • *****
  • Posts: 86
  • Karma: 4
    • View Profile
Re: Off before On
« Reply #8 on: October 22, 2014, 11:48:16 AM »
 :)