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

Offline jolerius

  • Full Member
  • ***
  • Posts: 102
  • Karma: +0/-0
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #15 on: December 19, 2013, 12:16:14 pm »
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

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #16 on: December 19, 2013, 12:39:50 pm »
Not dynamically. It would require modifying the D_xxx.json file and would effect all devices that use the plug-in.

- Garrett


Offline Ramias

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +7/-5
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #17 on: December 19, 2013, 02:45:23 pm »
Glad to see some life back in YNCA!

Is there a place we can review the code?  I'd like to confirm this is in it: http://forum.micasaverde.com/index.php/topic,13735.msg128286.html#msg128286

Or request that it be added if it is not already in the plugin.

Also, should I remove my old YNCA prior to installing this, or just install (and will it overwrite/upgrade my existing I, D, S and JSON files?  Will I have to recreate my scenes, or do the scene commands all have the same names?

Thanks

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #18 on: December 19, 2013, 02:53:22 pm »
Glad to see some life back in YNCA!

Is there a place we can review the code?  I'd like to confirm this is in it: http://forum.micasaverde.com/index.php/topic,13735.msg128286.html#msg128286

Or request that it be added if it is not already in the plugin.

Also, should I remove my old YNCA prior to installing this, or just install (and will it overwrite/upgrade my existing I, D, S and JSON files?  Will I have to recreate my scenes, or do the scene commands all have the same names?

Thanks

If it lets you overwrite the files that should be fine, that would save you from having to re create the scenes.

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.

Offline Ramias

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +7/-5
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #19 on: December 19, 2013, 03:08:33 pm »

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.

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.

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #20 on: December 19, 2013, 05:38:36 pm »

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.

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.

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
« Last Edit: December 20, 2013, 09:47:16 am by joey52685 »

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 839
  • Karma: +57/-8
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #21 on: December 19, 2013, 07:05:03 pm »
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: [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, THIS_LUL_DEVICE)
    end
end

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

NEW style:
updateVariable ("Zone3Power", parameter)
« Last Edit: December 20, 2013, 12:33:30 am by a-lurker »

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #22 on: December 19, 2013, 07:35:02 pm »
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: [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

    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

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

NEW style:
updateVariable ("Zone3Power", parameter)

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?
« Last Edit: December 19, 2013, 10:49:52 pm by joey52685 »

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 839
  • Karma: +57/-8
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #23 on: December 20, 2013, 12:32:35 am »
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.

Offline Cor

  • Hero Member
  • *****
  • Posts: 1184
  • Karma: +7/-4
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #24 on: December 20, 2013, 05:22:16 am »

I will look into that.  What settings would you want it to remember? Just volume and input?

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

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #25 on: December 20, 2013, 08:43:42 am »
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

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #26 on: December 20, 2013, 09:47:49 am »
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

Ok, I'll work on these changes.

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #27 on: December 20, 2013, 10:28:10 am »
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: [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, THIS_LUL_DEVICE)
    end
end

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

NEW style:
updateVariable ("Zone3Power", parameter)

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>

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #28 on: December 20, 2013, 10:46:35 am »
See if my version causes any error?

- Garrett

Offline Tank

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +11/-7
Re: Yamaha Network Control Alias Plugin 2.0
« Reply #29 on: December 20, 2013, 11:03:10 am »
See if my version causes any error?

- Garrett

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