Menu

Controlling a mp3d from one rocker

Help
toer
2008-06-01
2012-12-14
  • toer

    toer - 2008-06-01

    Hi,
    I'm trying to use one rocker to do various function on a mp3d on my server.
    This is linknx output while running:

    ObjectCondition (id='office_rocker3') evaluated as '1'
    Execute ShellCommandAction: mpc next
    Bob Dylan - Blowing in the Wind.mp3
    [playing] #33/61   0:00 (0%)
    volume: 90%   repeat: on    random: on
    Write from 1.1.17 to 0/0/33: 01
    Write from 1.1.17 to 0/0/33: 01
    Write from 1.1.17 to 0/0/33: 01
    Write from 1.1.17 to 0/0/33: 00
    New value 0 for switching object office_rocker3
    SwitchingObject (id=office_rocker3): Compare value_m='0' to value='1'
    ObjectCondition (id='office_rocker3') evaluated as '0'
    Write from 1.1.17 to 0/0/33: 01
    New value 1 for switching object office_rocker3
    SwitchingObject (id=office_rocker3): Compare value_m='1' to value='1'
    ObjectCondition (id='office_rocker3') evaluated as '1'
    Execute ShellCommandAction: mpc next
    The Scorpions - Wind Of Change
    [playing] #60/61   0:00 (0%)
    volume: 90%   repeat: on    random: on

    As you can se linknx recive every press on rocker 3 but does not care until the value is 0 again.
    Is there a flag or option i can make in my config to be able to get linknx to respond to every value 1 as a next and then use 0 as previous/change playlist??

    Kind regards,
    Tore

     
    • jef2000

      jef2000 - 2008-06-01

      Hi,

      There is no flag to do that, but you can use the following action to reset it to 0 once the command has been processed:

      <actionlist>
      <action type="shell-cmd" cmd="mpc next"/>
      <action type="set-value" id="office_rocker3" value="off"/>
      </actionlist>

      If you don't want that the 0 value is transmitted from linknx to the bus, you can remove the "transmit" flag on that object.

      Regards,

      Jean-François

       
      • toer

        toer - 2008-06-01

        Thats how i already had solved it with just reseting the value, but i wanted to have two functions on the same rocker. I tried removing the update flag but i just got a loop

        This is my config:
        <object id="office_rocker3" gad="0/0/33" type="EIS1" flags="cwt"></object>

        <rule id="test1">
          <condition type="object" id="office_rocker3" value="on" trigger="true" />
          <actionlist>
            <action type="shell-cmd" cmd="mpc next" />
            <action type="set-value" id="office_rocker3" value="off" />
          </actionlist>
        </rule>
        <rule id="test2">
          <condition type="object" id="office_rocker3" value="off" trigger="true" />
          <actionlist>
            <action type="shell-cmd" cmd="mpc prev" />
            <action type="set-value" id="office_rocker3" value="on" />
          </actionlist>
        </rule>

         
        • EPIX

          EPIX - 2008-06-02

          Hi dalaker!

          Sounds interesting...
          What ist Rocker? A Software i suppose, can you give ma a link to more information?
          (Google finds tooooo much with those keyords "rocker" ;-)

          greetings from Austria

           
    • jef2000

      jef2000 - 2008-06-03

      Hi,

      I looked at the code and I don't see any simple way to do this.
      Wouldn't it be simpler to configure the rocker differently? What kind of rocker is it?
      For example, if you configure it as a dimmer control, it will send "up" when you press one side, "stop" when you release the rocker and "down" when you press the other side. With that, the configuration of linknx would be much easier. You would just have to configure one action in case of "up" and one in case of "down", the "stop" sent when you release the button will ensure that when you press again the same button, linknx will always see it as a change from "stop" to "up" or "down".

      Regards,

      Jean-François

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.