openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[pioneeravr] Volume set for VSX 528 like AVRs #1344

Closed joeduck closed 3 years ago

joeduck commented 8 years ago

Hi, very nice Binding. It works very well for me. But some receivers, like my VSX 528, has no volume set command (VL), only VU and VD. For my homematic i had a workaround with a loop who set the Volume with x VU/VD commands. It would be nice, the binding has a function like this.

Here some code, sadly i am no java programmer (i am at the end no Programmer ;-)) This code is from http://forum.logicmachine.net/showthread.php?tid=15

`function setvolume(host, port, volumelevel)

local currentvolume = getvolume(host, port)

if volumelevel > currentvolume then for i = currentvolume, volumelevel -1, 2 do telnetsend(host,port,VOLUME_UP) end else for i = volumelevel, currentvolume-1, 2 do telnetsend(host,port,VOLUME_DOWN) end end

currentvolume = getvolume(host, port) return currentvolume

end

`

Greetings, Jochen

Stratehm commented 8 years ago

I will take a look at it.

The main question is how to detect that an AVR support or not the "Set volume" request. My AVR support it so I cannot test it. Could you try to open a telnet connection to your AVR and send a 001VL command (request to set the volume to -80.0 dB) ? What is the response of the AVR (maybe E4) ?

joeduck commented 8 years ago

HI. Many thanks! Sadly my receiver is by pioneer Germany for repair. It was not reachable on the lan any more. I have to wait 6 Weeks told me the repair station :-( .

Perhaps you can make a parameter in the binding for receivers without VL command like "vl=no"?

joeduck commented 7 years ago

Hi, i have my Receiver back. If I send the „001VL“ command, nothing Comes back. „?V“ gives the volume back. It would be great if you make a try.

Stratehm commented 7 years ago

Ok thanks for the test. A new version should soon be ready, but my AVR supports the Set Volume command so I cannot really test the new implementation. Will you be able to make some test with the new binding version when it is ready ?

Sschhsd commented 7 years ago

test

The telnet-response for the commands. I can test the new binding-version with the pioneer vsx-529

joeduck commented 7 years ago

Hi,

many thanks for your work on this. I also can do tests with my vsx 528k

Stratehm commented 7 years ago

Could you test the new binding version ? It is a jar file that you have to put in the addons folder of your openhab2 installation. (Make sure to have uninstalled the old binding before).

joeduck commented 7 years ago

Hi, i vaed stoped openhab. Then i has copied it to "/usr/share/openhab2/runtime/karaf/system/org/openhab/binding/org.openhab.binding.pioneeravr/2.0.0.b4" and renamed to "org.openhab.binding.pioneeravr-2.0.0.b4.jar". then i started openhab "service openhab2 start".

Then i removed it from paperui and added again. I use "autodetect" but the avr is shown offline. I go on testing. Thanks

Spilota commented 7 years ago

If you're avr is shown as offline, you may need to cycle power to free up the telnet connection.

Sschhsd commented 7 years ago

My Pioneer is online and linked.

sometimes when i am pressing the volume up button, then the volume will be set to max volume (like the script hangs up)...

joeduck commented 7 years ago

Did a new try like Sschhsd decribed. But the AVR ist still shown as offline. But i can get the Volume with "printf '%s\r\n' ?V | nc 192.168.178.15 8102" and switch Power, VU, VD and so on on cmdline. Whar is wrong?

joeduck commented 7 years ago

If I go to "things" an show properties, IP and protocol shown empty. When I go to the edit Button, the configuration Parameters are right. My AVR listen to Port 8102

joeduck commented 7 years ago

after a restart of openhab2 the AVR is shown online. But no command works. On Commandline i can do commands to the avr.

Sschhsd commented 7 years ago

Do you update your channel-ids in your *.items?

Befor i removed the pioneer-binding, i have deleted the pioneer-thing (openhab2 paperui). After i have copied the new binding, i added manually my pioneer with IP-Adresss and Port Number. I set the new settings "volume-auto..." to disabled.

Stratehm commented 7 years ago

Thank you all for testing.

To let me investigate your problems, I will need your binding debug logs. Could you add the following lines to your logback.xml file (at the end of the file, but before the \</configuration> line) ?

<appender name="PIONEERFILE" class="ch.qos.logback.core.FileAppender">
        <file>${openhab.logdir:-userdata/logs}/pioneer.log</file>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-30.30logger{36}:%-5line] - %msg%ex{10}%n</pattern>
        </encoder>
    </appender>

    <logger name="org.openhab.binding.pioneeravr" level="DEBUG" additivity="false">
        <appender-ref ref="PIONEERFILE"/>
    </logger>

After restarting openHab, it will create a new file named pioneer.log in your log directory containing the debug logs of the binding. Play a bit with the binding to generate enough data, post the file.

Sschhsd commented 7 years ago

Where i can find the logback.xml in openhab2?

There is no logback.xml at path /etc/openhab2/logback.xml...

Stratehm commented 7 years ago

My bad, it is a development file.

Append the following lines to openhabInstallDir/runtime/karaf/etc/org.ops4j.pax.logging.cfg :

# Pioneer Binding debug
log4j.logger.org.openhab.binding.pioneeravr=DEBUG,pioneer
log4j.additivity.org.openhab.binding.pioneeravr=false
log4j.appender.pioneer=org.apache.log4j.RollingFileAppender
log4j.appender.pioneer.layout=org.apache.log4j.PatternLayout
log4j.appender.pioneer.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j.appender.pioneer.file=${openhab.logdir}/pioneer.log
log4j.appender.pioneer.append=true
log4j.appender.pioneer.maxFileSize=10MB
log4j.appender.pioneer.maxBackupIndex=10
Sschhsd commented 7 years ago

Thank you.

Logging is enabled. I will do some tests and will provide you the log-file, within the next few days.

Thanks for implementing and supporting the volume set

Spilota commented 7 years ago

I've tested this implementation of the volume set on a VSX-1122. It appears to be working as expected. When the slider is moved too far, it does have some trouble keeping up. Log file below pioneer - VSX-1122 Unsupported.zip

Stratehm commented 7 years ago

Improved volume level tracking with this version

Sschhsd commented 7 years ago

It doesn't work. same issue with the max volume, when i press volume up one time....

pioneer.txt

joeduck commented 7 years ago

Hi. Did some testings with the latest version. It works 1 or 2 times. then the Volume runs max Vol or low Vol. I have enabled the logging, but where can i find the logfiles in karaf? Realy: Dont understand the Openhab2 file system :-( .

Stratehm commented 7 years ago

@joeduck the log file is located here : openhabInstallDir/userdata/logs/pioneer.log

A new version of the binding is available. It is an heavy refactoring with breaking changes. Before installing this version, be sure to remove your AVR Things.

Now, to declare things, the AVR model as to be one of the list (no more ipAvr):

genericAvr has to be used for AVR that are not yet supported. If you have an AVR that is not supported, you can try the genericAvr with default configuration or play with the parameters of the thing in PaperUI. If you find the configuration that works with your AVR, please tell me and I will add your AVR in the supported list.

You can also enable the logs as described above, play with your AVR genericAvr and give me the log, I will try to extract the good parameters for your AVR.

Thank you all for testing.

Sschhsd commented 7 years ago

Thank you!

I have the same issue. When i press volume up, the volume is set to max.

pioneer.txt

Spilota commented 7 years ago

Testing this with the VSX-1122 and VSX-1021, it is working great. I'm using the VSX-1021 and VSX-1022, which both support the set volume command. Log file below in case you need it.

pioneer.txt

A couple small issues:

The 2011 and 2012 models listed below should be supported, they all support the same basic command set:

Thanks for all the work on this!

joeduck commented 7 years ago

Many Thanks for your work! Now it works correct with my VSX-528-K. It was recognized as VSX-528-K and Generic AVR. I let all on standard settings but change port to 8102.

Again: Many thanks! One OT question: How can i set the Volume with a script without the Slider to a absolute value?

Sschhsd commented 7 years ago

@Stratehm Any update for my issue?

Stratehm commented 7 years ago

Sorry guys, I am really out of time for now. I am still working on the refactoring of the binding (the previous snapshots were an intermediate state) but not as fast as I would like.

I will try to give you some updates of the advancement...

joeduck commented 7 years ago

O.k. Thanks for your Work. One Thing: If I restart openhab2 the binding forgets the Port. The Port of my Receiver is 8102. If i set this in the Paper UI, the AVR is still offline. Looking at the log, shows it wants to connect still to Port 23.

mbuchberger1967 commented 7 years ago

Hi all, I have the same issue with my VSX-828. According to some doc I found in the internet "VSX-82TXS RS232C Protocol, 2006" the VSX-82 series should know the VOLUME_SET command, but with 2 digits: XXVL

When I tried the current pioneer binding I noticed that everything works, except for the VL command. I supposed it is because of the 2 or 3 digits (OH sends 3 digits, my spec said 2 digits). SO I downloaded the source for the binding and changed the command to 2 digits, but no effect. As far as I know VSX528 and 828 are very similar, so now I guess my VSX-828 doesnt know the command.

My questions:

  1. Can someone send me the spec for the IP protocol for VSX-528/828 ?
  2. In the stable relase the modification discussed here seems not yet to be delivered? Can I get this binding that support 528/828 model 2012?
  3. Can I get access to the source as well?
  4. My VSX-828 often answers with an "R" response which is not recognized by the binding. Could we add this? I could do impl and testing if I get some hints what to do.

Thanks Markus

mbuchberger1967 commented 7 years ago

Hi,

I found a link in this post to a special snapshot from 23-12-2016, but if I install this one I'll get an exception "hostname can't be null" though I configured the IP and port in the things file.

If I use the managed (auto-detected) thing, it always tries to connect to port 23, regardless what I enter and save in the PaperUI

Is there maybe a later snapshot that fixes the problem with the port? So I could test the binding with my VSX-828?

Thnaks Markus

mbuchberger1967 commented 7 years ago

@Stratehm Can u give us an update about the refactoring? I'm really awaiting the solution to set a volume for VSX_528/828 by sending multiple VU/VD commands.

Maybe this is already avail in a snapshot?

Cheers markus

Sschhsd commented 7 years ago

Hi @Stratehm

after i reboot my openhab-service, i get this error with all channels (VSX-529): Command for zone 1 not send since zone 1 is not supported by the AVR@192.168.0.5:8102. pioneer.txt

Pioneer-Snapshot: 2016-12-22 SNAPSHOT

Sschhsd commented 7 years ago

Hi @Stratehm,

i think there is a timeout problem at checking the support for zone 1. Could you please increase the timeout-value or retry the zone-support (for zone 1, because every device has a zone 1, or?) every 10 sec til its true. Maybe there is a problem with the telnet-session, because i can see the pioneer-response in my telnet session.

Thanks in Advance!

2017-04-23 09:48:52.854 [DEBUG] [internal.protocol.ip.IpAvrConnection] - Connected to 192.168.0.5:8102 2017-04-23 09:48:52.859 [DEBUG] [nternal.protocol.StreamAvrConnection] - Command sent to AVR @192.168.0.5:8102: ?P _2017-04-23 09:48:53.365 [DEBUG] [oneeravr.internal.handler.AvrHandler] - Timeout during checkStatus. java.util.concurrent.TimeoutException: No response received after 500 ms for the command ?P 2017-04-23 09:49:16.942 [DEBUG] [nternal.protocol.StreamAvrConnection] - Command sent to AVR @192.168.0.5:8102: ?P 2017-04-23 09:49:17.444 [INFO ] [oneeravr.internal.handler.AvrHandler] - Zone 1 not supported. Cause: Timeout. 2017-04-23 09:49:18.903 [DEBUG] [nternal.protocol.StreamAvrConnection] - Data received from AVR @192.168.0.5:8102: PWR0 2017-04-23 09:49:18.907 [DEBUG] [nternal.protocol.StreamAvrConnection] - Data received from AVR @192.168.0.5:8102: PWR0

Sschhsd commented 7 years ago

Hi @Stratehm,

could you please provide me a new snapshot includes the latest commits?

Thank in advance.

joeduck commented 7 years ago

Hi,

I am also interrestet.

Thanks

Sschhsd commented 7 years ago

Hi @Stratehm

i have testet the newest release of OpenHab (openHAB 2.2.0 Build #106). Your Snapshot 2016-12-22 SNAPSHOT does not work anymore with the latest OpenHab-Release. The pioneer-binding which is included into the latest snapshot of openhab does not have your implementation for my pioneer vsx-529.

Are you interested to insert your implementation to the official pioneer binding or could you please provide ma a new snapshot?

Thanks in Advance.

Stratehm commented 7 years ago

Hi @Sschhsd,

Could you test the last SNAPSHOT I have built 2 weeks ago? Here is the details of the version.

Thank you for your help.

joeduck commented 6 years ago

Hi Strathem,

wich version is now actual? I am on Openhab 2.2 with the Pioneer Addon wich comes with this Release. I have my Pioneer VSX-528 configured as "genericAvr". But the Volume Adust does not work like the old Version. I can not adjust the Volume propper. I have all settings testet and need help.

Can you give me a hint?

Thankes, Jochen

thebeater commented 5 years ago

Hi @Stratehm,

is your binding in the official Release for Version Openhab 2.4 integrated with the setvolume Feature?

I can't get it working because no Version of the Pioneer's in the "choose thing"-Dialog is working for me.

Could you provide an Snapshot or inform when you plan the integration in Openhab official?

thebeater commented 5 years ago

@joeduck Did you get the binding working?

J-N-K commented 5 years ago

According to https://github.com/openhab/openhab2-addons/issues/1344#issuecomment-269010761 the original issue was solved. @Stratehm are these changes merged? If not, can you point me to the PR or raise a new PR? Thanks.

nils commented 4 years ago

I have an VSX 528 as well, currently maintaining my own copy of the binding to support it.

@Stratehm: Do you see a chance that you finish your refactoring? Otherwise I could try and tackle the topic.

hmerk commented 3 years ago

closed due to inactivity.