Yamaha Network Control Alias Plugin

Do not query, just compare to a previously cached value of the variable.
The cache should be initialized to a non valid value when your plugin is initialized.
The first time your check for write … it will fail and you will actually write the variable.
And of course you save the new value.
After that it will only write when you actually change a value.

The RX-V673 does have two zones:

http://usa.yamaha.com/products/audio-visual/av-receivers-amps/rx/rx-v673_black_u/?mode=model

It’s possible I have the second zone just disabled, which could occur with any model. If a zone is unavailable can you just disable requests to that Zone and log that a request was made to a disabled zone? Note that I’m not requesting the plugin to do anything - the log messages I see are just the result of the plugin being installed and running.

As you say, there are a lot of models and trying to manage all the variations is problematic !

@RichardTSchaefer
Can you point to example code of how you are caching/reading/writing/comparing your state variables please? Could save a bit of time.

[quote=“dgdev, post:19, topic:174366”][quote=“riochicken, post:16, topic:174366”]Hi, just installed it @home and it works perfectly! If do have a question: is it possible to stream a file (MP3 or something similair) to the amplifier? I would like to create an alarm which turns on the amplifier and plays an alarming sound…

Thank you for this plugin!![/quote]

Riochicken: what receiver model are you using, so I can update the list?

As for the alarm question, the YNCA does not have a method to stream a file. You might be able to do something with network streaming from a media device (if your receiver supports that), but you’re on your own for that one. As @TheSaint suggested, you’re probably better off with an actual siren if your goal is an alarming sound.[/quote]

The goal was to use the receiver as an alarm, simply due to the fact I already have it, can set the volume with your tool, and I can set it to use the USB connection which it will automatically play so cheaper than the alarm device in my opninion…

I have the yamaha RX-A810 and very pleased until know… :slight_smile:

This plugin works perfectly for my Yamaha RX-A720 under 1.5.345 code.

Unfortunately I just upgraded to 1.5.622 code to fix another issue I was seeing and this plugin has stopped functioning - here’s what I see in the Lua log:

09 03/16/13 11:00:06.725 JobHandler_LuaUPnP::Run device 212 Yamaha RX-A720 room 11 type urn:schemas-micasaverde-com:device:receiver:1 id parent 0/0xaa1f38 upnp: 0 <0x400>
50 03/16/13 11:00:26.722 luup_log:212: YamahaReceiver: Running I_YamahaReceiver1.xml on 192.168.0.110 <0x402>
50 03/16/13 11:01:26.000 luup_log:212: YamahaReceiver: Cannot send command @SYS:MODELNAME=? communications error <0x402>
50 03/16/13 11:01:56.020 luup_log:212: YamahaReceiver: Cannot send command @MAIN:AVAIL=? communications error <0x402>
50 03/16/13 11:02:26.014 luup_log:212: YamahaReceiver: Cannot send command @ZONE2:AVAIL=? communications error <0x402>

1.5.622 just got out of beta and is now the official firmware:

http://forum.micasaverde.com/index.php/topic,14189.msg72513/

so perhaps others will start experiencing this same problem of the plugin not working anymore.

Is there a specific log file the Yamaha plugin logs to other than the LuaUPnP.log? I’d like to start troubleshooting this on my own and see the exact commands being sent and why they are failing.

No, it is using luup.log function to write to the LuaUPnP.log file. Also, it is using the standard luup.io.write command using the crlf protocol to send the commands via serial or ip.

I’m going to have to upgrade my unit to 1.5.622 to see if I experience the same results. My initial thoughts on your first report were there was an issue with the beta and implementation of luup.io.write. To be determined once some testing is done…

Okay, I just upgrade my Vera Lite following the provided directions. The unit restarted and I’m not seeing any errors in the logs and the plugin is working as expected. Not seeing the results you’ve found, nathanhall.

Can you turn on Verbose logging? You’ll need to see what the Vera is saying is happening when the plugin is making the luup.io.write call.

I had deleted the Yamaha device I created from Vera as it stopped working after the 1.5.622 upgrade. I just created a new one now, and the new Yamaha device has no problems and functions perfectly.

Based on this experience - for anyone who runs into problems with their Yamaha plugin after the upgrade to 1.5.622 (in my case the device had a red banner at the bottom with the words “Lua Failure” repeated multiple times) I’d suggest deleting the device and recreating.

Glad you got it working. That’s probably good advice for any plugin that just stops working after an upgrade.

Too bad we didn’t get more diagnostics from the logs. As I mentioned before, the plugin is using the standard IO methods - it really isn’t the plugin’s fault if Vera is not allowing the write command to occur. The plugin actually responded as it was supposed to - it threw a communications error when the write command failed.

All going OK with a RX-V673 - good stuff. Can I suggest the code test for Zone 3 and enable/disable Zone 3 functionality, based on the returned message. Otherwise the keepAlive function keeps spitting out errors every 30 secs.

[code]In function deferredStartup
– RX-V673 does not have a Zone 3
– sendCommand({“ZONE3”, “BASIC”, “?”})

In function keepAlive
– RX-V673 does not have a Zone 3
– sendCommand({“ZONE3”, “AVAIL”, “?”})[/code]

The log file was busy with some stuff it didn’t understand. Here’s the RX-V673 additions, if you ever decide to do any updates:

[code]Un-handled System Function:
INPNAMEHDMI1
INPNAMEHDMI2
INPNAMEHDMI3
INPNAMEHDMI4
INPNAMEHDMI5
HDMIOUT1

Un-handled MAIN Function:
SWFRTRIM
STRAIGHT
ENHANCER
3DCINEMA
TONEBASS
TONETREBLE
ADAPTIVEDRC
DIALOGUELVL[/code]

I just realized…I never posted about this. I’ve been so busy as of late.

I stuck a z-wave outlet on the wall in my theater so that the receiver, amps, tv, etc wasn’t trickling power anymore. This is where there is a conflict. If you restart the vera due to changes to scenes and such and the power to the outlet is off, it no longer works with the scenes.

So, to break it down.

  1. Turn outlet off (no power to receiver)
  2. Restart vera
    • Last msg the box at top says is: Yamaha Central Control[19] : Running Lua Startup
  3. Scroll down devices to where receiver is and it says “Lua Failure Lua Failure Lua Failure Lua Failure Lua” underneath.
  4. Turn outlet on and watch as receiver gets power (little red light turns on)
  5. Run any scene on the vera that turns the receiver on…anything else in the scene will work…receiver part does not respond.

So if vera starts up but can’t see the receiver due to no power running to it…all actions in regards to the receiver seem to be void from that point on.

This appears to be a Vera wide problem. If you break a net connection eg unplug the LAN cable to a device or turn the device power off and then on again, the net connection is not re-established by the software. The only way to get it to work (in this case) is to turn on the Yamaha RX and restart the Vera Luup engine.

There appears to be no luup.io.close() function, so you cannot close the connection and open a new one. If you try and open a new connection with luup.io.open() you get an error in the log file, saying there is already an open connection but unfortunately it appears you can no longer access it. If any one knows how to handle this I would love to know how it’s done. However, I suspect this is a well know problem that has not be addressed by MCV. Should probably check the bug reports. I get the same problem with an iTach GC100. If you lose power, you permanently lose the LAN connection till the next restart - it’s a major hassle and a major flaw.

Just on the “Lua Failure Lua Failure Lua Failure Lua Failure Lua”. If you leave it for a while this string becomes huge as the “Lua Failure” is concatenated with the existing string each time. That is each time the function keepAlive finds the connection dead; then every 30 seconds the string gets extended. Long term this could could be a Vera failure point?

EDIT:
Unplug the LAN cable to a device: the connection will re-establish when the cable is plugged back in - while it’s unplugged Vera will detect errors.

Hopefully this fix will improve matters for when a device is actually powered on/off: http://bugs.micasaverde.com/view.php?id=2282

Interesting…that is indeed a problem. I really hope they look at solving that. I submitted a message to MCV linking to those last two posts. Hopefully they can consider looking into it as that is a show stopper for certain devices. I have had the Vera for about 7-8 months now and the firmware screen hasn’t shown an update yet so I’m assuming they are probably working on one by now.

Added a bug report for “Lua Failure” concatenation problem:

http://bugs.micasaverde.com/view.php?id=3087

I’ve been absent for a number of months and just came back. Uploaded your plugin to my Vera, created the device and I’m attempting to control my Yamaha HTR-7065 receiver.

The standard device lets me switch it off and correctly identifies the input correctly as HDMI2
In the advanced settings, it’s pulled to correct names for the AV inputs and other statuses. Indicating correct setup?

I was not able to switch it back on for some reason using the device in AVGear. I noticed the same behavior on the Yamaha app. Checked receiver settings and network standby was set to off. Duh!

Volume level returns with a 'not implemented"

Thanks for your work…

Just found this thread and can report pretty much the same thing as the other HTR-7065 (Costco model) user.

I have On/Off and “not implemented” when I adjust the volume. I didn’t see a place to control the inputs. HTR-7065 firmware version 1.80.

Bit more info required:
On/Off works?
What does the Vera log file show when adjusting the volume and do you have ascreen capture of the Not implemented: message. Refer to:
http://forum.micasaverde.com/index.php/topic,13477.msg100381.html#msg100381

On adjusting the values try the following:
Automation–>New Scene–>Advanced–>Pick a Device–> select “Yamaha Receiver (YNCA)” --> Add
Then select the function you want to add.

Sorry for the delay. I’ve been gone for the week.

Attached is the screenshot that happens when I adjust the volume.

Here are my log files when I click volume on the YNCA device:

50 09/13/13 13:10:04.137 luup_log:47: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e712680>

06 09/13/13 13:10:34.120 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:10:34.123 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:10:34.131 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:10:34.133 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
50 09/13/13 13:10:34.133 luup_log:46: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e512680>
06 09/13/13 13:10:34.135 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:10:34.136 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
50 09/13/13 13:10:34.137 luup_log:47: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e712680>

06 09/13/13 13:11:04.121 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:11:04.123 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:11:04.132 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:11:04.134 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
50 09/13/13 13:11:04.135 luup_log:46: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e512680>
06 09/13/13 13:11:04.136 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:11:04.137 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
50 09/13/13 13:11:04.138 luup_log:47: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e712680>

06 09/13/13 13:11:34.147 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 LEAK this:40960 start:1155072 to 0xb6f000 <0x2e712680>
06 09/13/13 13:11:34.149 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:11:34.150 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:11:34.151 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:11:34.152 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
50 09/13/13 13:11:34.153 luup_log:46: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e512680>
06 09/13/13 13:11:34.259 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
50 09/13/13 13:11:34.260 luup_log:47: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e712680>
02 09/13/13 13:11:36.061 JobHandler_LuaUPnP::REQ_Handler no handler for lr_foscam_tripped <0x2e297680>

08 09/13/13 13:11:39.587 JobHandler_LuaUPnP::HandleActionRequest device: 47 service: urn:ynca-com:serviceId:Receiver1 action: SetVolumeTarget <0x2e297680>
08 09/13/13 13:11:39.587 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=47 <0x2e297680>
08 09/13/13 13:11:39.588 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:ynca-com:serviceId:Receiver1 <0x2e297680>
08 09/13/13 13:11:39.588 JobHandler_LuaUPnP::HandleActionRequest argument action=SetVolumeTarget <0x2e297680>
08 09/13/13 13:11:39.588 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=10 <0x2e297680>
08 09/13/13 13:11:39.588 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.9249741425442888 <0x2e297680>
02 09/13/13 13:11:39.589 Device_LuaUPnP::HandleActionRequest 47 none of the 1 implementations handled it <0x2e297680>
02 09/13/13 13:11:39.589 JobHandler_LuaUPnP::RunAction device 47 action urn:ynca-com:serviceId:Receiver1/SetVolumeTarget failed with 501/No implementation <0x2e297680>

02 09/13/13 13:12:02.101 LOG_CHECK_MEMORY_LEAK pMem start 0xaa0000 now 0xb6f000 last 0xb65000 leaked 847872 <0x2b697680>

06 09/13/13 13:12:04.122 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:12:04.124 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Model was: HTR-7065 now: HTR-7065 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:12:04.133 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
06 09/13/13 13:12:04.134 Device_Variable::m_szValue_set device: 47 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e712680>
50 09/13/13 13:12:04.135 luup_log:47: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e712680>
06 09/13/13 13:12:04.137 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: MainAvailable was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
06 09/13/13 13:12:04.148 Device_Variable::m_szValue_set device: 46 service: urn:ynca-com:serviceId:Receiver1 variable: Zone2Available was: Not Ready now: Not Ready #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e512680>
50 09/13/13 13:12:04.149 luup_log:46: YamahaReceiver: Error: @RESTRICTED The function requested is not supported on this receiver. <0x2e512680>

I can report that

A) It “works” on RX-V671. Well at least the power and reporting of the zone
B) When I try to do a Scene I get "Invalid JSON for device #11 (where in Device #11 is the ID for my receiver.

EDIT: It works via Scenes when I use the fwd1. address instead of going directly to the local IP – Great job OP!!!

So the graphical controller doesn’t work well for me but I can control my receiver via scenes (yeah!).