Author Topic: Yamaha Network Control Alias Plugin 2.0  (Read 59692 times)

Online a-lurker

  • Hero Member
  • *****
  • Posts: 765
  • Karma: +43/-8
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #30 on: December 20, 2013, 05:19:14 pm »
OK this code should work:

Code: [Select]
-- if non existent, create the variable
-- update the variable only if needs to be
function updateVariable(varK, varV, sid)
    if (sid == nil) then sid = YAMAHA_SID end

    local newValue = tostring(varV)
    --debug(varK..' = '..newValue)

    local currentValue = luup.variable_get(sid, varK, lul_device)
    if ((currentValue ~= newValue) or (currentValue == nil)) then
        luup.variable_set(sid, varK, newValue, lul_device)
    end
end

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #31 on: December 20, 2013, 07:05:56 pm »
OK this code should work:

Code: [Select]
-- if non existent, create the variable
-- update the variable only if needs to be
function updateVariable(varK, varV, sid)
    if (sid == nil) then sid = YAMAHA_SID end

    local newValue = tostring(varV)
    --debug(varK..' = '..newValue)

    local currentValue = luup.variable_get(sid, varK, lul_device)
    if ((currentValue ~= newValue) or (currentValue == nil)) then
        luup.variable_set(sid, varK, newValue, lul_device)
    end
end

Thanks a-lurker, I got it working using garrettwp's code.  I'll include it in the next release

Offline Aegis

  • Full Member
  • ***
  • Posts: 139
  • Karma: +1/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #32 on: December 20, 2013, 07:52:08 pm »
How do you change inputs?  The only thing I see is on/off volume and mute.  All of the variables in the Advanced tab just seem to represent present state.  If I change MainInput for example, it just goes back to whatever is currently on the receiver.

Online a-lurker

  • Hero Member
  • *****
  • Posts: 765
  • Karma: +43/-8
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #33 on: December 20, 2013, 08:41:33 pm »
Select the Automation Tab - make a New scene - go to the Advanced Tab - select the plugin from the pull down list "Pick a device" and select Add. You are then presented with a list of all the functions you can use - select as needed.

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #34 on: December 20, 2013, 10:03:59 pm »
There's an example of a scene to launch Pandora on the first page.  Eventually there will be more control from the dashboard as well.

Offline scootboot

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #35 on: December 21, 2013, 05:41:43 am »
Hello!  This is a repost from the old YNCA thread but I thought I would ask again here as it seems to be where the action is....

I am trying to get my RX-V673 to start/stop music from an inserted USB drive.  I can turn on/off my receiver and even switch to the USB input but can't actually get music playing(using only this plugin).  When you switch to USB, it shows you a list of tracks on the drive and you have to select one to get it playing.

For my purposes, I would just like to be able to trigger a random order performance which I think I could do with the following steps:

1. turn receiver on
2. select usb input
3.  select whichever song comes up first (always the same) with a "select" or "enter" type command
4.  Forward to the next track which should be random as I have the "Random" and "Repeat All" settings engaged which seem to persist throughout off/on cycles.

I think what I am asking is if there is any way to implement then trigger the "select" command and the "forward to next track" command using this plugin.

It seems like being able to trigger a random playlist from a usb stick would be a pretty popular feature, so I thought I would make the request/ask the question.

Thanks!

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #36 on: December 21, 2013, 09:40:29 am »
Hello!  This is a repost from the old YNCA thread but I thought I would ask again here as it seems to be where the action is....

I am trying to get my RX-V673 to start/stop music from an inserted USB drive.  I can turn on/off my receiver and even switch to the USB input but can't actually get music playing(using only this plugin).  When you switch to USB, it shows you a list of tracks on the drive and you have to select one to get it playing.

For my purposes, I would just like to be able to trigger a random order performance which I think I could do with the following steps:

1. turn receiver on
2. select usb input
3.  select whichever song comes up first (always the same) with a "select" or "enter" type command
4.  Forward to the next track which should be random as I have the "Random" and "Repeat All" settings engaged which seem to persist throughout off/on cycles.

I think what I am asking is if there is any way to implement then trigger the "select" command and the "forward to next track" command using this plugin.

It seems like being able to trigger a random playlist from a usb stick would be a pretty popular feature, so I thought I would make the request/ask the question.

Thanks!

I just added a bunch of new commands that should be helpful for everyone building scenes.  There are some USB specific commands that I will add later as well, but I hope these cover what you need for now.  Check the first post for the files.

        <!-- MAIN: Playback Controls -->
   <action><name>MainPlay</name></action>
   <action><name>MainPause</name></action>
   <action><name>MainStop</name></action>
   <action><name>MainRev</name></action>
   <action><name>MainFwd</name></action>
   
   <!-- MAIN: Cursor Controls -->
   <action><name>MainUp</name></action>
   <action><name>MainDown</name></action>
   <action><name>MainLeft</name></action>
   <action><name>MainRight</name></action>
   <action><name>MainSel</name></action>
   <action><name>MainReturn</name></action>
   <action><name>MainHome</name></action>
   
   <!-- MAIN: Menu Controls -->
   <action><name>MainOnScreen</name></action>
   <action><name>MainTopMenu</name></action>
   <action><name>MainMenu</name></action>
   <action><name>MainOption</name></action>
   <action><name>MainDisplay</name></action>
« Last Edit: December 21, 2013, 09:47:21 am by joey52685 »

Offline Aegis

  • Full Member
  • ***
  • Posts: 139
  • Karma: +1/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #37 on: December 21, 2013, 09:51:16 am »
Perfect.  Thanks a-lurker.  Are the delays in that example a necessity?

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #38 on: December 21, 2013, 09:53:19 am »
Great. Can't wait for the volumeslider and input button/s.

By the way. Is it possible to rename the inputs so that it's more easy to find a specific input? for example av1 - sonos, hdmi2 -  tv, hdmi3 - xbox etc

It looks like I can pull custom input names that you set on the receiver, I'll see how I can integrate this into the plugin to make inputs easier to indentify.

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #39 on: December 21, 2013, 10:02:25 am »
Perfect.  Thanks a-lurker.  Are the delays in that example a necessity?

I read that the receiver needs 100 milliseconds between commands.  You can try it without the delays it won't do any harm.

Offline Aegis

  • Full Member
  • ***
  • Posts: 139
  • Karma: +1/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #40 on: December 21, 2013, 10:08:04 am »
Perfect.  Thanks a-lurker.  Are the delays in that example a necessity?

I read that the receiver needs 100 milliseconds between commands.  You can try it without the delays it won't do any harm.

Gotcha.  My A3010 does have inherent delays, so that makes sense.

Offline Aegis

  • Full Member
  • ***
  • Posts: 139
  • Karma: +1/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #41 on: December 21, 2013, 11:44:12 am »
Don't forget Party Mode...

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #42 on: December 21, 2013, 11:57:52 am »
Don't forget Party Mode...

Party options are already available:

<!-- SYSTEM: Party -->
   <action><name>SystemPartyOn</name></action>
   <action><name>SystemPartyOff</name></action>
   <action><name>SystemPartyVolUp</name></action>
   <action><name>SystemPartyVolDown</name></action>
   <action><name>SystemPartyMuteOn</name></action>
   <action><name>SystemPartyMuteOff</name></action>

Offline jullio

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +0/-1
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #43 on: December 21, 2013, 01:30:12 pm »
I wanted to chime in and say that part of this is wrong. You should use the standard service types as much as possible. For the service id to set the volume it should be this:

Code: [Select]
<action>
<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
<name>SetVolume</name>
<run>
    sendCommand({"MAIN", "VOL", lul_settings.DesiredVolume ..".0"})
</run>
</action>

I suggest that you look at the Sonos or the Squeezebox plugin for some pointers on the service types for media / av control.

You'll also want to add this to your xml:

Code: [Select]
<service>
    <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
    <SCPDURL>S_RenderingControl1.xml</SCPDURL>
</service>

- Garrett

It is not wrong there are many ways to control volume.  A lot of plugins use the slider and volume the same way I do.  There are many ways to implement the slider and both work.  If it works then use it.

Offline Aegis

  • Full Member
  • ***
  • Posts: 139
  • Karma: +1/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #44 on: December 21, 2013, 02:46:06 pm »
I set up a Scene to turn my tuner on Monday through Friday when the motion sensor outside my bedroom is triggered however, it is unclear how I can limit this to a time frame, example only between 5AM and 6AM.  Can I do this or do I need PLEG?