Yamaha Network Control Alias Plugin 2.0

[quote=“Ramias, post:20, topic:178312”][quote=“joey52685, post:19, topic:178312”]Which inputs do you need added to zone 2? I will make sure to include them in the next release.

The files are not encrypted or anything you can download them and look at the code.[/quote]

I need AV5 and AV6 for Zone 2 added.

Where can I view the files from without installing from the apps.mios.com store? I checked code.mios.com but did not see the files.[/quote]

Ok Av5 and 6 have been added for zone 2. Code is attached. This will be included in the next official release.

Edit: Sorry attached the wrong file

In line with this post:
http://forum.micasaverde.com/index.php/topic,13735.msg103746.html#msg103746
Could you use please incorporate this (untested) code. If not I can do it, if interested.

[code]

– 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, THIS_LUL_DEVICE)
end

end[/code]

OLD style:
luup.variable_set(YAMAHA_SID, “Zone3Power”, parameter, lul_device)

NEW style:
updateVariable (“Zone3Power”, parameter)

[quote=“a-lurker, post:22, topic:178312”]In line with this post:
http://forum.micasaverde.com/index.php/topic,13735.msg103746.html#msg103746
Could you use please incorporate this (untested) code. If not I can do it, if interested.

[code]

– 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

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, THIS_LUL_DEVICE)
end

end[/code]

OLD style:
luup.variable_set(YAMAHA_SID, “Zone3Power”, parameter, lul_device)

NEW style:
updateVariable (“Zone3Power”, parameter)[/quote]

I’m happy to make the change, it seems like a pretty simple find/replace. I can see that it is checking for a change before setting the variable, can you help me understand what benefit that provides?

Reading through the other posts, it looks like it’s to keep the log file from getting cluttered when nothing has actually changed, is that correct?

Yep - that’s pretty much it. As I understand it - it’s considered “polite”; by keeping the comms traffic between devices to a minimum and the log file clean.

Cool , that would be great!

Things to be saved for me would be:
-if the device is on or standby.
-Input
-volume

Thanks a lot!

Cor

I posted a thread a few days ago regarding some things for developers to do when creating plugins:

http://forum.micasaverde.com/index.php/topic,18746.0.html

The one suggestion by a-lurker is on par with one of my tips.

  • Garrett

[quote=“garrettwp, post:26, topic:178312”]I posted a thread a few days ago regarding some things for developers to do when creating plugins:

http://forum.micasaverde.com/index.php/topic,18746.0.html

The one suggestion by a-lurker is on par with one of my tips.

  • Garrett[/quote]

Ok, I’ll work on these changes.

[quote=“a-lurker, post:22, topic:178312”]In line with this post:
http://forum.micasaverde.com/index.php/topic,13735.msg103746.html#msg103746
Could you use please incorporate this (untested) code. If not I can do it, if interested.

[code]

– 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, THIS_LUL_DEVICE)
end

end[/code]

OLD style:
luup.variable_set(YAMAHA_SID, “Zone3Power”, parameter, lul_device)

NEW style:
updateVariable (“Zone3Power”, parameter)[/quote]

The plugin throws an error after this change. Not sure I there’s a problem with the code or I did something wrong.

Device_Interface::CreateLuaInterface 62 failed to start engine <0x2af33000>

See if my version causes any error?

  • Garrett

[quote=“garrettwp, post:29, topic:178312”]See if my version causes any error?

  • Garrett[/quote]

That seems to work. I’ll include the change in the next release.

OK this code should work:

[code]-- 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[/code]

[quote=“a-lurker, post:31, topic:178312”]OK this code should work:

[code]-- 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[/code][/quote]

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

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.

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.

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.

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!

[quote=“scootboot, post:36, topic:178312”]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![/quote]

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>

Perfect. Thanks a-lurker. Are the delays in that example a necessity?

[quote=“jolerius, post:16, topic:178312”]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[/quote]

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.

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