Python Plugin: Pioneer AVR

Python and python framework

Moderator: leecollings

febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Python Plugin: Pioneer AVR

Post by febalci »

Hi all,

This is my first attempt on Pioneer AVR plugin, it is written for my VSX-921 unit. Please note that it is probably full of bugs, and at its best it is a beta. For those who would like to test it and inform me of the outcome, or just fork it and use it for their own purpose please welcome to do so. It will probably work for SC-37, SC-35, VSX-32, VSX-33, VSX 900, VSX 1120. For other models you can just test it. I tested it on Domoticz Beta with VSX-921K. Then i got bored since i am using Harmony remote with the unit and honestly will not be using this. But if there is any request for it, i might force myself a little bit more...

Good Luck;
https://github.com/febalci/DomoticzPioneerAVR
Xorfor

Re: Python Plugin: Pioneer AVR

Post by Xorfor »

I started working on a plugin for the Pioneer VSX528. Unfortunately the VSX528 only uses VU and VD, and NOT nnnVL for volume control :( . Can you also implement that?
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

Xorfor wrote: Thursday 21 December 2017 21:02 Unfortunately the VSX528 only uses VU and VD
Well for starters, domoticz doesn't have up down button for device. We either have to implement 2 seperate push buttons or a blinds device. I do not know if blinds device icons are customizable because as far as i know most of the device icons are non-customizable. If you can live with that... :?:

UPDATE: On second thought, maybe i can convert slider values in a for loop. Like send 15 VU commands in a row. I'll try it, which version is better for you push-buttons or slider?
Xorfor

Re: Python Plugin: Pioneer AVR

Post by Xorfor »

That is what I did. I created a slider and the code:

Code: Select all

        if (Unit == self.MAINVOLUME):
            if str(Command) == "Set Level":
                level = int(str(Level))
                delta = level - self.mainVolume
                Domoticz.Debug("delta: "+str(delta))
                for i in range(0, abs(delta), self.VOLUMESTEP):
                    if delta < 0:
                        self.mainVolume -= self.VOLUMESTEP
                        self.avrConn.Send(Message='VD\r')
                        Domoticz.Debug("VD")
                    elif delta > 0:
                        self.mainVolume += self.VOLUMESTEP
                        self.avrConn.Send(Message='VU\r')
                        Domoticz.Debug("VU")
So I request the current volume and store it in self.mainVolume. If the slider is moved up or down, I calculate the difference and send multiple VU or VD ( be aware that VU or VD goes in steps of 2. self.VOLUMESTEP = 2
It is working not that bad :).
The main question is then: how to identify which command is supported by a Pioneer AVR: nnnVL or VU/VD?
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

Xorfor wrote: Thursday 21 December 2017 23:48 The main question is then: how to identify which command is supported by a Pioneer AVR: nnnVL or VU/VD?
How does VSX528 respond to nnnVL command, does it respond with a E04 or some error code else? If that is the condition, it is easy to implement.
Xorfor

Re: Python Plugin: Pioneer AVR

Post by Xorfor »

I opened a telnet session. Approx. every minute I get an 'R'. Also when I give eg. '060VL' (or any other invalid command) I get an 'R'. When I enter VD it gives me the current volume level:

Code: Select all

R
R
R
R
R
VOL060
R
061VL
R
XXX
R
R
R
R
VD
VOL059
VU
VOL061
?V
VOL061
Perhaps that can be used? Perhaps you need to send a sequence of commands to change the volume a little and check whether the volume is changed.
Korrel
Posts: 9
Joined: Friday 31 January 2014 11:02
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by Korrel »

Woooow, what a very good worked out plan... Just the plugin that i was looking for!!! Very good work !!!

To contribute to this plugin, i added some lines to the input_modes in pioneerapi.py (to support the inputs on my vsx-922)...
I also put them in order to help me finding the missing ones:
(and maybe it's an idea, to complete all the numbers to the list, with unknown for those we don't know)

Code: Select all

INPUT_MODES= {
    '00' : 'PHONO',
    '01' : 'CD',
    '02' : 'TUNER',
    '03' : 'CD-R/TAPE',
    '04' : 'DVD',
    '05' : 'TV/SAT',
    '06' : 'SAT/CBL',
    '10' : 'VIDEO 1',
    '12' : 'MULTI CH IN',
    '14' : 'VIDEO 2',
    '15' : 'DVR/BDR',
    '17' : 'iPod/USB',
    '18' : 'XM RADIO',
    '19' : 'HDMI 1',
    '20' : 'HDMI 2',
    '21' : 'HDMI 3',
    '22' : 'HDMI 4',
    '23' : 'HDMI 5',
    '24' : 'HDMI 6',
    '25' : 'BD',
    '26' : 'H.M.G.',
    '27' : 'SIRIUS',
    '31' : 'HDMI (cyclic)',
    '33' : 'ADAPTER PORT',
    '38' : 'INTERNET RADIO',
    '40' : 'SiriusXM',
    '41' : 'PANDORA',
    '44' : 'MEDIA SERVER',
    '45' : 'FAVORITES'
}
Secondly it's an idea to put the InputIdx string from plugin.py in a device parameter inputs ????

Since the input device wasn't supported to the home app through homebridge i made some several dummy switches which through blockly set the right input ;)

So now i can talk to siri and control my vsx-922...


Keep up this good work !!!!!!
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

Korrel wrote: Tuesday 02 January 2018 11:08
Secondly it's an idea to put the InputIdx string from plugin.py in a device parameter inputs ????
Thanks Korrel, i am happy that the plugin worked out for you. Also thanks for the correction of the list, i committed the changes to the pioneer.py on github.

Can you please explain your comment above, about the InputIdx, maybe with an example?
biggav
Posts: 7
Joined: Wednesday 02 August 2017 5:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by biggav »

I just added the plugin and it looks pretty awesome!

On my system i use the zone 2 heaps and would like to control that. Has any one done it?

I have been duplicating the code and i think i have ot pretty sorted but cant get it to add the aditional devices, it this a limitation to domoticz or an error with my code? I suspect im in over my head with it all.
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

biggav wrote: Wednesday 11 April 2018 14:09 I have been duplicating the code and i think i have ot pretty sorted but cant get it to add the aditional devices, it this a limitation to domoticz or an error with my code? I suspect im in over my head with it all.
If you can send me your code, i might check it out
biggav
Posts: 7
Joined: Wednesday 02 August 2017 5:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by biggav »

pioneerapi.py
Spoiler: show
#!/usr/bin/env python

#Main Zone
INPUT_MODES= {
'00' : 'PHONO',
'01' : 'CD',
'02' : 'TUNER',
'03' : 'CD-R/TAPE',
'04' : 'DVD',
'05' : 'TV/SAT',
'06' : 'SAT/CBL',
'10' : 'VIDEO 1',
'12' : 'MULTI CH IN',
'14' : 'VIDEO 2',
'15' : 'DVR/BDR',
'17' : 'iPod/USB',
'18' : 'XM RADIO',
'19' : 'HDMI 1',
'20' : 'HDMI 2',
'21' : 'HDMI 3',
'22' : 'HDMI 4',
'23' : 'HDMI 5',
'24' : 'HDMI 6',
'25' : 'BD',
'26' : 'H.M.G.',
'27' : 'SIRIUS',
'31' : 'HDMI (cyclic)',
'33' : 'ADAPTER PORT',
'38' : 'INTERNET RADIO',
'40' : 'SiriusXM',
'41' : 'PANDORA',
'44' : 'MEDIA SERVER',
'45' : 'FAVORITES'
}

LISTENING_MODES = {
'0001' : 'STEREO (cyclic)',
'0010' : 'STANDARD',
'0009' : 'STEREO (direct set)',
'0011' : '(2ch source)',
'0013' : 'PRO LOGIC2 MOVIE',
'0018' : 'PRO LOGIC2x MOVIE',
'0014' : 'PRO LOGIC2 MUSIC',
'0019' : 'PRO LOGIC2x MUSIC',
'0015' : 'PRO LOGIC2 GAME',
'0020' : 'PRO LOGIC2x GAME',
'0031' : 'PRO LOGIC2z HEIGHT',
'0032' : 'WIDE SURROUND MOVIE',
'0033' : 'WIDE SURROUND MUSIC',
'0012' : 'PRO LOGIC',
'0016' : 'Neo:6 CINEMA',
'0017' : 'Neo:6 MUSIC',
'0028' : 'XM HD SURROUND',
'0029' : 'NEURAL SURROUND',
'0037' : 'Neo:X CINEMA',
'0038' : 'Neo:X MUSIC',
'0039' : 'Neo:X GAME',
'0040' : 'NEURAL SURROUND+Neo:X CINEMA',
'0041' : 'NEURAL SURROUND+Neo:X MUSIC',
'0042' : 'NEURAL SURROUND+Neo:X GAME',
'0021' : '(Multi ch source)',
'0022' : '(Multi ch source)+DOLBY EX',
'0023' : '(Multi ch source)+PRO LOGIC2x MOVIE',
'0024' : '(Multi ch source)+PRO LOGIC2x MUSIC',
'0034' : '(Multi-ch Source)+PRO LOGIC2z HEIGHT',
'0035' : '(Multi-ch Source)+WIDE SURROUND MOVIE',
'0036' : '(Multi-ch Source)+WIDE SURROUND MUSIC',
'0025' : '(Multi ch source)DTS-ES Neo:6',
'0026' : '(Multi ch source)DTS-ES matrix',
'0027' : '(Multi ch source)DTS-ES discrete',
'0030' : '(Multi ch source)DTS-ES 8ch discrete',
'0043' : '(Multi ch source)DTS-ES Neo:X',
'0100' : 'ADVANCED SURROUND (cyclic)',
'0101' : 'ACTION',
'0103' : 'DRAMA',
'0102' : 'SCI-FI',
'0105' : 'MONO FILM',
'0104' : 'ENTERTAINMENT SHOW',
'0106' : 'EXPANDED THEATER',
'0116' : 'TV SURROUND',
'0118' : 'ADVANCED GAME',
'0117' : 'SPORTS',
'0107' : 'CLASSICAL',
'0110' : 'ROCK/POP',
'0109' : 'UNPLUGGED',
'0112' : 'EXTENDED STEREO',
'0003' : 'Front Stage Surround Advance Focus',
'0004' : 'Front Stage Surround Advance Wide',
'0153' : 'RETRIEVER AIR',
'0113' : 'PHONES SURROUND',
'0050' : 'THX (cyclic)',
'0051' : 'PROLOGIC + THX CINEMA',
'0052' : 'PL2 MOVIE + THX CINEMA',
'0053' : 'Neo:6 CINEMA + THX CINEMA',
'0054' : 'PL2x MOVIE + THX CINEMA',
'0092' : 'PL2z HEIGHT + THX CINEMA',
'0055' : 'THX SELECT2 GAMES',
'0068' : 'THX CINEMA (for 2ch)',
'0069' : 'THX MUSIC (for 2ch)',
'0070' : 'THX GAMES (for 2ch)',
'0071' : 'PL2 MUSIC + THX MUSIC',
'0072' : 'PL2x MUSIC + THX MUSIC',
'0093' : 'PL2z HEIGHT + THX MUSIC',
'0073' : 'Neo:6 MUSIC + THX MUSIC',
'0074' : 'PL2 GAME + THX GAMES',
'0075' : 'PL2x GAME + THX GAMES',
'0094' : 'PL2z HEIGHT + THX GAMES',
'0076' : 'THX ULTRA2 GAMES',
'0077' : 'PROLOGIC + THX MUSIC',
'0078' : 'PROLOGIC + THX GAMES',
'0201' : 'Neo:X CINEMA + THX CINEMA',
'0202' : 'Neo:X MUSIC + THX MUSIC',
'0203' : 'Neo:X GAME + THX GAMES',
'0056' : 'THX CINEMA (for multi ch)',
'0057' : 'THX SURROUND EX (for multi ch)',
'0058' : 'PL2x MOVIE + THX CINEMA (for multi ch)',
'0095' : 'PL2z HEIGHT + THX CINEMA (for multi ch)',
'0059' : 'ES Neo:6 + THX CINEMA (for multi ch)',
'0060' : 'ES MATRIX + THX CINEMA (for multi ch)',
'0061' : 'ES DISCRETE + THX CINEMA (for multi ch)',
'0067' : 'ES 8ch DISCRETE + THX CINEMA (for multi ch)',
'0062' : 'THX SELECT2 CINEMA (for multi ch)',
'0063' : 'THX SELECT2 MUSIC (for multi ch)',
'0064' : 'THX SELECT2 GAMES (for multi ch)',
'0065' : 'THX ULTRA2 CINEMA (for multi ch)',
'0066' : 'THX ULTRA2 MUSIC (for multi ch)',
'0079' : 'THX ULTRA2 GAMES (for multi ch)',
'0080' : 'THX MUSIC (for multi ch)',
'0081' : 'THX GAMES (for multi ch)',
'0082' : 'PL2x MUSIC + THX MUSIC (for multi ch)',
'0096' : 'PL2z HEIGHT + THX MUSIC (for multi ch)',
'0083' : 'EX + THX GAMES (for multi ch)',
'0097' : 'PL2z HEIGHT + THX GAMES (for multi ch)',
'0084' : 'Neo:6 + THX MUSIC (for multi ch)',
'0085' : 'Neo:6 + THX GAMES (for multi ch)',
'0086' : 'ES MATRIX + THX MUSIC (for multi ch)',
'0087' : 'ES MATRIX + THX GAMES (for multi ch)',
'0088' : 'ES DISCRETE + THX MUSIC (for multi ch)',
'0089' : 'ES DISCRETE + THX GAMES (for multi ch)',
'0090' : 'ES 8CH DISCRETE + THX MUSIC (for multi ch)',
'0091' : 'ES 8CH DISCRETE + THX GAMES (for multi ch)',
'0204' : 'Neo:X + THX CINEMA (for multi ch)',
'0205' : 'Neo:X + THX MUSIC (for multi ch)',
'0206' : 'Neo:X + THX GAMES (for multi ch)',
'0005' : 'AUTO SURR/STREAM DIRECT (cyclic)',
'0006' : 'AUTO SURROUND',
'0151' : 'Auto Level Control (A.L.C.)',
'0007' : 'DIRECT',
'0008' : 'PURE DIRECT',
'0152' : 'OPTIMUM SURROUND'
}

PLAYING_MODES = {
'0101' : '[)(]PLIIx MOVIE',
'0102' : '[)(]PLII MOVIE',
'0103' : '[)(]PLIIx MUSIC',
'0104' : '[)(]PLII MUSIC',
'0105' : '[)(]PLIIx GAME',
'0106' : '[)(]PLII GAME',
'0107' : '[)(]PROLOGIC',
'0108' : 'Neo:6 CINEMA',
'0109' : 'Neo:6 MUSIC',
'010a' : 'XM HD Surround',
'010b' : 'NEURAL SURR ',
'010c' : '2ch Straight Decode',
'010d' : '[)(]PLIIz HEIGHT',
'010e' : 'WIDE SURR MOVIE',
'010f' : 'WIDE SURR MUSIC',
'0110' : 'STEREO',
'0111' : 'Neo:X CINEMA',
'0112' : 'Neo:X MUSIC',
'0113' : 'Neo:X GAME',
'0114' : 'NEURAL SURROUND+Neo:X CINEMA',
'0115' : 'NEURAL SURROUND+Neo:X MUSIC',
'0116' : 'NEURAL SURROUND+Neo:X GAMES',
'1101' : '[)(]PLIIx MOVIE',
'1102' : '[)(]PLIIx MUSIC',
'1103' : '[)(]DIGITAL EX',
'1104' : 'DTS +Neo:6 / DTS-HD +Neo:6',
'1105' : 'ES MATRIX',
'1106' : 'ES DISCRETE',
'1107' : 'DTS-ES 8ch ',
'1108' : 'multi ch Straight Decode',
'1109' : '[)(]PLIIz HEIGHT',
'110a' : 'WIDE SURR MOVIE',
'110b' : 'WIDE SURR MUSIC',
'110c' : 'ES Neo:X',
'0201' : 'ACTION',
'0202' : 'DRAMA',
'0203' : 'SCI-FI',
'0204' : 'MONOFILM',
'0205' : 'ENT.SHOW',
'0206' : 'EXPANDED',
'0207' : 'TV SURROUND',
'0208' : 'ADVANCEDGAME',
'0209' : 'SPORTS',
'020a' : 'CLASSICAL ',
'020b' : 'ROCK/POP ',
'020c' : 'UNPLUGGED ',
'020d' : 'EXT.STEREO ',
'020e' : 'PHONES SURR. ',
'020f' : 'FRONT STAGE SURROUND ADVANCE FOCUS',
'0210' : 'FRONT STAGE SURROUND ADVANCE WIDE',
'0211' : 'SOUND RETRIEVER AIR',
'0301' : '[)(]PLIIx MOVIE +THX',
'0302' : '[)(]PLII MOVIE +THX',
'0303' : '[)(]PL +THX CINEMA',
'0304' : 'Neo:6 CINEMA +THX',
'0305' : 'THX CINEMA',
'0306' : '[)(]PLIIx MUSIC +THX',
'0307' : '[)(]PLII MUSIC +THX',
'0308' : '[)(]PL +THX MUSIC',
'0309' : 'Neo:6 MUSIC +THX',
'030a' : 'THX MUSIC',
'030b' : '[)(]PLIIx GAME +THX',
'030c' : '[)(]PLII GAME +THX',
'030d' : '[)(]PL +THX GAMES',
'030e' : 'THX ULTRA2 GAMES',
'030f' : 'THX SELECT2 GAMES',
'0310' : 'THX GAMES',
'0311' : '[)(]PLIIz +THX CINEMA',
'0312' : '[)(]PLIIz +THX MUSIC',
'0313' : '[)(]PLIIz +THX GAMES',
'0314' : 'Neo:X CINEMA + THX CINEMA',
'0315' : 'Neo:X MUSIC + THX MUSIC',
'0316' : 'Neo:X GAMES + THX GAMES',
'1301' : 'THX Surr EX',
'1302' : 'Neo:6 +THX CINEMA',
'1303' : 'ES MTRX +THX CINEMA',
'1304' : 'ES DISC +THX CINEMA',
'1305' : 'ES 8ch +THX CINEMA ',
'1306' : '[)(]PLIIx MOVIE +THX',
'1307' : 'THX ULTRA2 CINEMA',
'1308' : 'THX SELECT2 CINEMA',
'1309' : 'THX CINEMA',
'130a' : 'Neo:6 +THX MUSIC',
'130b' : 'ES MTRX +THX MUSIC',
'130c' : 'ES DISC +THX MUSIC',
'130d' : 'ES 8ch +THX MUSIC',
'130e' : '[)(]PLIIx MUSIC +THX',
'130f' : 'THX ULTRA2 MUSIC',
'1310' : 'THX SELECT2 MUSIC',
'1311' : 'THX MUSIC',
'1312' : 'Neo:6 +THX GAMES',
'1313' : 'ES MTRX +THX GAMES',
'1314' : 'ES DISC +THX GAMES',
'1315' : 'ES 8ch +THX GAMES',
'1316' : '[)(]EX +THX GAMES',
'1317' : 'THX ULTRA2 GAMES',
'1318' : 'THX SELECT2 GAMES',
'1319' : 'THX GAMES',
'131a' : '[)(]PLIIz +THX CINEMA',
'131b' : '[)(]PLIIz +THX MUSIC',
'131c' : '[)(]PLIIz +THX GAMES',
'131d' : 'Neo:X + THX CINEMA',
'131e' : 'Neo:X + THX MUSIC',
'131f' : 'Neo:X + THX GAMES',
'0401' : 'STEREO',
'0402' : '[)(]PLII MOVIE',
'0403' : '[)(]PLIIx MOVIE',
'0404' : 'Neo:6 CINEMA',
'0405' : 'AUTO SURROUND Straight Decode',
'0406' : '[)(]DIGITAL EX',
'0407' : '[)(]PLIIx MOVIE',
'0408' : 'DTS +Neo:6',
'0409' : 'ES MATRIX',
'040a' : 'ES DISCRETE',
'040b' : 'DTS-ES 8ch ',
'040c' : 'XM HD Surround',
'040d' : 'NEURAL SURR ',
'040e' : 'RETRIEVER AIR',
'040f' : 'Neo:X CINEMA',
'0410' : 'ES Neo:X',
'0501' : 'STEREO',
'0502' : '[)(]PLII MOVIE',
'0503' : '[)(]PLIIx MOVIE',
'0504' : 'Neo:6 CINEMA',
'0505' : 'ALC Straight Decode',
'0506' : '[)(]DIGITAL EX',
'0507' : '[)(]PLIIx MOVIE',
'0508' : 'DTS +Neo:6',
'0509' : 'ES MATRIX',
'050a' : 'ES DISCRETE',
'050b' : 'DTS-ES 8ch ',
'050c' : 'XM HD Surround',
'050d' : 'NEURAL SURR ',
'050e' : 'RETRIEVER AIR',
'050f' : 'Neo:X CINEMA',
'0510' : 'ES Neo:X',
'0601' : 'STEREO',
'0602' : '[)(]PLII MOVIE',
'0603' : '[)(]PLIIx MOVIE',
'0604' : 'Neo:6 CINEMA',
'0605' : 'STREAM DIRECT NORMAL Straight Decode',
'0606' : '[)(]DIGITAL EX',
'0607' : '[)(]PLIIx MOVIE',
'0608' : '(nothing)',
'0609' : 'ES MATRIX',
'060a' : 'ES DISCRETE',
'060b' : 'DTS-ES 8ch ',
'060c' : 'Neo:X CINEMA',
'060d' : 'ES Neo:X',
'0701' : 'STREAM DIRECT PURE 2ch',
'0702' : '[)(]PLII MOVIE',
'0703' : '[)(]PLIIx MOVIE',
'0704' : 'Neo:6 CINEMA',
'0705' : 'STREAM DIRECT PURE Straight Decode',
'0706' : '[)(]DIGITAL EX',
'0707' : '[)(]PLIIx MOVIE',
'0708' : '(nothing)',
'0709' : 'ES MATRIX',
'070a' : 'ES DISCRETE',
'070b' : 'DTS-ES 8ch ',
'070c' : 'Neo:X CINEMA',
'070d' : 'ES Neo:X',
'0881' : 'OPTIMUM',
'0e01' : 'HDMI THROUGH',
'0f01' : 'MULTI CH IN'
}

#Zone 2
Z2_INPUT_MODES= {
'00' : 'PHONO',
'01' : 'CD',
'02' : 'TUNER',
'03' : 'CD-R/TAPE',
'04' : 'DVD',
'05' : 'TV/SAT',
'06' : 'SAT/CBL',
'10' : 'VIDEO 1',
'12' : 'MULTI CH IN',
'14' : 'VIDEO 2',
'15' : 'DVR/BDR',
'17' : 'iPod/USB',
'18' : 'XM RADIO',
'19' : 'HDMI 1',
'20' : 'HDMI 2',
'21' : 'HDMI 3',
'22' : 'HDMI 4',
'23' : 'HDMI 5',
'24' : 'HDMI 6',
'25' : 'BD',
'26' : 'H.M.G.',
'27' : 'SIRIUS',
'31' : 'HDMI (cyclic)',
'33' : 'ADAPTER PORT',
'38' : 'INTERNET RADIO',
'40' : 'SiriusXM',
'41' : 'PANDORA',
'44' : 'MEDIA SERVER',
'45' : 'FAVORITES'
}

class pioneerapi:

#Inquire
#Main Zone
qry_PowerStatus = '?P\r'
qry_InputStatus = '?F\r'
qry_VolumeStatus = '?V\r'
qry_ListeningModeStatus = '?S\r'
qry_PlayingModeStatus = '?L\r'

#Zone 2
qry_Z2_PowerStatus = '?AP\r'
qry_Z2_InputStatus = '?ZS\r'
qry_Z2_VolumeStatus = '?ZV\r'

#Command
#Main Zone
cmd_PowerOn = 'PO\r'
cmd_PowerOff = 'PF\r'
cmd_PowerOnOff = 'PZ\r'

#Zone 2
cmd_Z2_PowerOn = 'APO\r'
cmd_Z2_PowerOff = 'APF\r'
cmd_Z2_PowerOnOff = 'APZ\r'

def __init__(self):
return

#Information Request (request FL display information)
def FL_decode(self, fl_text):
decoded_fl = ''
for i in range(2, 30, 2):
char = fl_text[i:i+2]
try:
decoded_fl += chr(int(char,16))
except KeyError:
decoded_fl += '?'
return decoded_fl

#Main Zone Input
def FN_decode(self,fn_text):
decoded_fn = ''
try:
decoded_fn = INPUT_MODES[fn_text]
except KeyError:
decoded_fn = "INPUT KEY ERROR"
return decoded_fn

#Main Zone Listening Mode
def SR_decode(self,sr_text):
decoded_sr = ''
try:
decoded_sr = LISTENING_MODES[sr_text]
except KeyError:
decoded_sr = "LISTENING MODE KEY ERROR"
return decoded_sr

#Main Zone Playing Mode
def LM_decode(self,lm_text):
decoded_lm = ''
try:
decoded_lm = PLAYING_MODES[lm_text]
except KeyError:
decoded_lm = "PLAYING MODE KEY ERROR"
return decoded_lm

#Zone 2 Input
def Z2F_decode(self,z2f_text):
decoded_z2f = ''
try:
decoded_z2f = Z2_INPUT_MODES[z2f_text]
except KeyError:
decoded_z2f = "ZONE 2 INPUT KEY ERROR"
return decoded_z2f

#Gets Input names and updates list from AVR
def RGB_decode(self,rgb_text):
decoded_rgb = None
if rgb_text[2:3] == '1':
INPUT_MODES.update({rgb_text[0:2]:rgb_text[3:]})
Z2_INPUT_MODES.update({rgb_text[0:2]:rgb_text[3:]})
decoded_rgb = rgb_text
return decoded_rgb

plugin.py
Spoiler: show
"""
<plugin key="PioneerAVR" name="Pioneer AVR" author="febalci" version="0.9.0">
<params>
<param field="Address" label="IP Address" width="250px" required="true" default="192.168.1.224"/>
<param field="Port" label="Port" width="50px" required="true" default="8102"/>
<param field="Mode6" label="Debug" width="75px">
<options>
<option label="True" value="Debug"/>
<option label="False" value="Normal" default="true" />
</options>
</param>
</params>
</plugin>
"""
import Domoticz
import pioneerapi

class BasePlugin:

nextConnect = 3
oustandingPings = 0

UNITS = {
'power': 1,
'input': 2,
'display': 3,
'listening_mode': 4,
'playing_mode': 5,
'main_volume': 6,
'z2_power': 7,
'z2_input': 8,
'z2_volume': 9
}
PioneerConn = None

#Main Zone
power_on = False
volume_level = None
mute = None
input_rgb_name = None
input_mode = "0"
listening_mode = None
playing_mode = None
display_text = None
InputIdx = ("01","02","03","04","05","10","14","15","17","25","26")

#Zone 2
z2_power_on = False
z2_volume_level = None
z2_mute = None
z2_input_rgb_name = None
z2_input_mode = "0"
z2_InputIdx = ("01","02","03","04","05","10","14","15","17","25","26")

def __init__(self):
#self.var = 123
return

def onStart(self):
Domoticz.Debug("onStart called")

if Parameters["Mode6"] == "Debug":
Domoticz.Debugging(1)

#Main Zone
InputSelections = 'Off'
for a in self.InputIdx:
InputSelections = InputSelections+'|'+pioneerapi.INPUT_MODES[a]
Domoticz.Debug('LIST:'+InputSelections)

SourceOptions = {'LevelActions': '|'*InputSelections.count('|'),
'LevelNames': InputSelections,
'LevelOffHidden': 'false',
'SelectorStyle': '1'}

if self.UNITS['power'] not in Devices:
Domoticz.Device(Name="Power", Unit=self.UNITS['power'], TypeName="Switch", Image=5, Used=1).Create()
if self.UNITS['input'] not in Devices:
Domoticz.Device(Name="Input", Unit=self.UNITS['input'], TypeName="Selector Switch", Switchtype=18, Image=5, Options=SourceOptions, Used=1).Create()
if self.UNITS['display'] not in Devices:
Domoticz.Device(Name="Display", Unit=self.UNITS['display'], TypeName="Text", Image=5, Used=1).Create()
if self.UNITS['listening_mode'] not in Devices:
Domoticz.Device(Name="Listening Mode", Unit=self.UNITS['listening_mode'], TypeName="Text", Used=1).Create()
if self.UNITS['playing_mode'] not in Devices:
Domoticz.Device(Name="Playing Mode", Unit=self.UNITS['playing_mode'], TypeName="Text", Used=1).Create()
if self.UNITS['main_volume'] not in Devices:
Domoticz.Device(Name="Volume Main Zone", Unit=self.UNITS['main_volume'], Type=244, Subtype=73, Switchtype=7, Image=8, Used=1).Create()

#Zone 2
Z2InputSelections = 'Off'
for a in self.Z2_InputIdx:
Z2InputSelections = Z2InputSelections+'|'+pioneerapi.Z2_INPUT_MODES[a]
Domoticz.Debug('LIST:'+Z2InputSelections)

Z2SourceOptions = {'LevelActions': '|'*Z2InputSelections.count('|'),
'LevelNames': Z2InputSelections,
'LevelOffHidden': 'false',
'SelectorStyle': '1'}

if self.UNITS['z2_power'] not in Devices:
Domoticz.Device(Name="Zone 2 Power", Unit=self.UNITS['z2_power'], TypeName="Switch", Image=5, Used=1).Create()
if self.UNITS['z2_input'] not in Devices:
Domoticz.Device(Name="Zone 2 Input", Unit=self.UNITS['z2_input'], TypeName="Selector Switch", Switchtype=18, Image=5, Options=Z2SourceOptions, Used=1).Create()
if self.UNITS['z2_volume'] not in Devices:
Domoticz.Device(Name="Volume Zone 2", Unit=self.UNITS['z2_volume'], Type=244, Subtype=73, Switchtype=7, Image=8, Used=1).Create()

DumpConfigToLog()
self.SyncDevices(1)
self.PioneerConn = Domoticz.Connection(Name="Telnet", Transport="TCP/IP", Protocol="Line", Address=Parameters["Address"], Port=Parameters["Port"])
self.PioneerConn.Connect()
Domoticz.Heartbeat(30)

def onStop(self):
Domoticz.Log("onStop called")

def onConnect(self, Connection, Status, Description):
global api

Domoticz.Debug("onConnect called")
if Status == 0:
self.isConnected = True
Domoticz.Debug("Connected successfully to: "+Parameters["Address"]+":"+Parameters["Port"])
api = pioneerapi.pioneerapi()
self.PioneerConn.Send('\r') #Send <CR> to wake unit from stanby
self.PioneerConn.Send(api.qry_PowerStatus, Delay=1)
self.PioneerConn.Send(api.qry_InputStatus, Delay=2)
self.PioneerConn.Send(api.qry_VolumeStatus, Delay=3)
self.PioneerConn.Send(api.qry_ListeningModeStatus, Delay=4)
self.PioneerConn.Send(api.qry_Z2_PowerStatus, Delay=5)
self.PioneerConn.Send(api.qry_Z2_InputStatus, Delay=6)
self.PioneerConn.Send(api.qry_Z2_VolumeStatus, Delay=7)
wait=8
for key in self.InputIdx:
wait += 1
self.PioneerConn.Send("?RGB"+str(key)+"\r", Delay=wait)
else:
self.isConnected = False
self.power_on = False
self.SyncDevices(1)
Domoticz.Debug("Failed to connect ("+str(Status)+") to: "+Parameters["Address"]+":"+Parameters["Port"]+" with error: "+Description)
return

def onMessage(self, Connection, Data):
Domoticz.Debug("onMessage called")
self.oustandingPings = self.oustandingPings - 1
strData = Data.decode("utf-8", "ignore")
Domoticz.Debug("onMessage called with Data: '"+str(strData)+"'")

strData = strData.strip()
shaction = strData[0:2]
shdetail = strData[2:]
loaction = strData[0:3]
lodetail = strData[3:]

if loaction == 'PWR': #POWER
if lodetail == '0': #PWR0
self.power_on = True
self.PioneerConn.Send(api.qry_VolumeStatus, Delay=0)
else: #PWR1
self.power_on = False
elif loaction == 'VOL': #VOLUME
self.volume_level = str(round((int(str(lodetail))*100)/185))
elif loaction == 'MUT': #MUTE
if lodetail == '0': #MUT0
self.mute = 'On'
else: #MUT1
self.mute = 'Off'
elif loaction == 'RGB': #INPUT NAME
self.input_rgb_name = api.RGB_decode(str(lodetail))
if self.input_rgb_name != None:
Domoticz.Debug('RGB:'+self.input_rgb_name)
InputSelections = 'Off'
for a in self.InputIdx:
InputSelections = InputSelections+'|'+pioneerapi.INPUT_MODES[a]
Domoticz.Debug('LIST:'+InputSelections)

SourceOptions = {'LevelActions': '|'*InputSelections.count('|'),
'LevelNames': InputSelections,
'LevelOffHidden': 'false',
'SelectorStyle': '1'}
Devices[self.UNITS['input']].Update(nValue = 0, sValue = "Off", Options = SourceOptions)

elif shaction == 'FN': #Main Zone INPUT
self.input_mode = self.selector_find(str(shdetail), 0)
Domoticz.Debug('FN:'+str(self.input_mode))
elif shaction == 'Z2F': #Zone 2 INPUT
self.input_mode = self.selector_find(str(shdetail), 0)
Domoticz.Debug('Z2F:'+str(self.input_mode))
elif shaction == 'SR': #LISTENING MODE
self.listening_mode = api.SR_decode(str(shdetail))
Domoticz.Debug('SR:'+self.listening_mode)
elif shaction == 'LM': #PLAYING LISTENING MODE
self.playing_mode = api.LM_decode(str(shdetail))
Domoticz.Debug('LM:'+self.playing_mode)
elif shaction == 'FL': #DISPLAY TEXT
self.display_text = api.FL_decode(str(shdetail))
Domoticz.Debug('FL:'+self.display_text)
self.SyncDevices(0)
return

def onCommand(self, Unit, Command, Level, Hue):
Domoticz.Debug("onCommand called for Unit " + str(Unit) + ": Parameter '" + str(Command) + "', Level: " + str(Level))
action, sep, params = Command.partition(' ')
action = action.capitalize()
params = params.capitalize()
if Unit == self.UNITS['power']:
if Command=='Off':
Domoticz.Debug("Unit Power Off")
self.PioneerConn.Send(Message=api.cmd_PowerOff, Delay=0)
self.power_on = False
elif Command=='On':
Domoticz.Debug("Unit Power On")
self.PioneerConn.Send(Message=api.cmd_PowerOn, Delay=0)
self.power_on = True
elif Unit == self.UNITS['main_volume']:
if (action == "On"):
self.PioneerConn.Send(Message='MF\r', Delay=0)
elif (action == "Set"):
self.volume_level = str(round((int(Level)*185)/100)).rjust(3,'0')
self.PioneerConn.Send(Message=self.volume_level+'VL\r', Delay=0)
elif (action == "Off"):
self.PioneerConn.Send(Message='MO\r', Delay=0)
Domoticz.Debug('Level:'+str(Level))
elif Unit == self.UNITS['input']:
if (action == "Set"):
if Level != "0":
self.input_mode = self.selector_find(Level,1)
self.PioneerConn.Send(Message=self.input_mode+'FN\r', Delay=0)
else:
self.power_on = False
self.PioneerConn.Send(Message=api.cmd_PowerOff, Delay=0)

#Zone 2
def onCommand(self, Unit, Command, Level, Hue):
Domoticz.Debug("onCommand called for Unit " + str(Unit) + ": Parameter '" + str(Command) + "', Level: " + str(Level))
action, sep, params = Command.partition(' ')
action = action.capitalize()
params = params.capitalize()
if Unit == self.UNITS['z2_power']:
if Command=='Off':
Domoticz.Debug("Unit Power Off")
self.PioneerConn.Send(Message=api.cmd_Z2_PowerOff, Delay=0)
self.power_on = False
elif Command=='On':
Domoticz.Debug("Unit Power On")
self.PioneerConn.Send(Message=api.cmd_Z2_PowerOn, Delay=0)
self.power_on = True
elif Unit == self.UNITS['z2_volume']:
if (action == "On"):
self.PioneerConn.Send(Message='Z2MF\r', Delay=0) #mute on function
elif (action == "Set"):
self.volume_level = str(round((int(Level)*185)/100)).rjust(3,'0')
self.PioneerConn.Send(Message=self.volume_level+'ZV\r', Delay=0)
elif (action == "Off"):
self.PioneerConn.Send(Message='Z2MO\r', Delay=0) #mute off function
Domoticz.Debug('Level:'+str(Level))
elif Unit == self.UNITS['z2_input']:
if (action == "Set"):
if Level != "0":
self.input_mode = self.selector_find(Level,1)
self.PioneerConn.Send(Message=self.z2_input_mode+'ZS\r', Delay=0)
else:
self.power_on = False
self.PioneerConn.Send(Message=api.cmd_Z2_PowerOff, Delay=0)


def onNotification(self, Name, Subject, Text, Status, Priority, Sound, ImageFile):
Domoticz.Log("Notification: " + Name + "," + Subject + "," + Text + "," + Status + "," + str(Priority) + "," + Sound + "," + ImageFile)

def onDisconnect(self, Connection):
Domoticz.Log("onDisconnect called")
self.isConnected = False

def onHeartbeat(self):
if (self.PioneerConn.Connected() == True):
if (self.oustandingPings > 3):
Domoticz.Debug("Ping Timeout, Disconnect")
self.PioneerConn.Disconnect()
self.nextConnect = 0
else:
self.PioneerConn.Send(Message=api.qry_PowerStatus,Delay=0)
Domoticz.Debug("POWER STATUS Message Sent")
self.oustandingPings = self.oustandingPings + 1
else:
# if not connected try and reconnected every 2 heartbeats
self.oustandingPings = 0
self.nextConnect = self.nextConnect - 1
if (self.nextConnect <= 0):
self.nextConnect = 3
self.PioneerConn.Connect()
return

def SyncDevices(self, TimedOut):
if (self.power_on == False):
UpdateDevice(self.UNITS['power'], 0, "Off", TimedOut)
UpdateDevice(self.UNITS['input'], 0, "0", TimedOut)
UpdateDevice(self.UNITS['display'], 0, "", TimedOut)
UpdateDevice(self.UNITS['listening_mode'], 0, "", TimedOut)
UpdateDevice(self.UNITS['playing_mode'], 0, "", TimedOut)
UpdateDevice(self.UNITS['main_volume'], 0, self.volume_level, TimedOut)
else:
UpdateDevice(self.UNITS['power'], 1 , "On", TimedOut)
UpdateDevice(self.UNITS['input'], int(self.input_mode), str(self.input_mode), TimedOut)
UpdateDevice(self.UNITS['display'], 0, self.display_text, TimedOut)
UpdateDevice(self.UNITS['listening_mode'], 0, self.listening_mode, TimedOut)
UpdateDevice(self.UNITS['playing_mode'], 0, self.playing_mode, TimedOut)
UpdateDevice(self.UNITS['main_volume'],2,self.volume_level, TimedOut)
return

def selector_find(self, query, ctype):
if ctype == 0:
sel = (self.InputIdx.index(str(query))+1)*10 #Off olduğu için +1 var
Domoticz.Debug('INDEX:'+str(sel))
else:
sel = self.InputIdx[int((query/10)-1)] #Off olduğu için -1 var
return sel

global _plugin
_plugin = BasePlugin()

def onStart():
global _plugin
_plugin.onStart()

def onStop():
global _plugin
_plugin.onStop()

def onConnect(Connection, Status, Description):
global _plugin
_plugin.onConnect(Connection, Status, Description)

def onMessage(Connection, Data):
global _plugin
_plugin.onMessage(Connection, Data)

def onCommand(Unit, Command, Level, Hue):
global _plugin
_plugin.onCommand(Unit, Command, Level, Hue)

def onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile):
global _plugin
_plugin.onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile)

def onDisconnect(Connection):
global _plugin
_plugin.onDisconnect(Connection)

def onHeartbeat():
global _plugin
_plugin.onHeartbeat()

# Generic helper functions

def UpdateDevice(Unit, nValue, sValue, TimedOut):
# Make sure that the Domoticz device still exists (they can be deleted) before updating it
if (Unit in Devices):
if (Devices[Unit].nValue != nValue) or (Devices[Unit].sValue != sValue) or (Devices[Unit].TimedOut != TimedOut):
Devices[Unit].Update(nValue=nValue, sValue=str(sValue), TimedOut=TimedOut)
Domoticz.Log("Update "+str(nValue)+":'"+str(sValue)+"' ("+Devices[Unit].Name+")")
return

def DumpConfigToLog():
for x in Parameters:
if Parameters[x] != "":
Domoticz.Debug( "'" + x + "':'" + str(Parameters[x]) + "'")
Domoticz.Debug("Device count: " + str(len(Devices)))
for x in Devices:
Domoticz.Debug("Device: " + str(x) + " - " + str(Devices[x]))
Domoticz.Debug("Device ID: '" + str(Devices[x].ID) + "'")
Domoticz.Debug("Device Name: '" + Devices[x].Name + "'")
Domoticz.Debug("Device nValue: " + str(Devices[x].nValue))
Domoticz.Debug("Device sValue: '" + Devices[x].sValue + "'")
Domoticz.Debug("Device LastLevel: " + str(Devices[x].LastLevel))
return
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

biggav wrote: Wednesday 11 April 2018 14:09 I have been duplicating the code and i think i have ot pretty sorted but cant get it to add the aditional devices, it this a limitation to domoticz or an error with my code? I suspect im in over my head with it all.
Dear biggav,

It's all about python errors; typos and a forgotten OnCommand:
Use these; I cannot test it since my dumb old avr is only one Zone (or at least i am using only 1); But you can test and send me the results to solve it.
pioneerapi.py:
Change section:

Code: Select all

#Zone 2 Input
    def Z2F_decode(self,z2f_text):
        decoded_z2f = ''
        try:
            decoded_z2f = Z2_INPUT_MODES[z2f_text]
        except KeyError:
        	decoded_z2f = "ZONE 2 INPUT KEY ERROR"
        return decoded_z2f
to:

Code: Select all

#Zone 2 Input
    def Z2F_decode(self,z2f_text):
        decoded_z2f = ''
        try:
            decoded_z2f = INPUT_MODES[z2f_text]
        except KeyError:
        	decoded_z2f = "ZONE 2 INPUT KEY ERROR"
        return decoded_z2f
So, what i changed there is; use INPUT_MODES instead of Z2_INPUT_MODES since you did not defined Z2_INPUT_MODES and it is simply the same with INPUT_MODES content, so you can use it.

and in plugin.py; there are more typos and errors, so use this instead:

Code: Select all

"""
<plugin key="PioneerAVR" name="Pioneer AVR" author="febalci" version="0.9.0">
    <params>
        <param field="Address" label="IP Address" width="250px" required="true" default="192.168.1.60"/>
        <param field="Port" label="Port" width="50px" required="true" default="8102"/>
        <param field="Mode6" label="Debug" width="75px">
            <options>
                <option label="True" value="Debug"/>
                <option label="False" value="Normal"  default="true" />
            </options>
        </param>
    </params>
</plugin>
"""
import Domoticz
import pioneerapi

class BasePlugin:

    nextConnect = 3
    oustandingPings = 0

    UNITS = {
        'power': 1,
        'input': 2,
        'display': 3,
        'listening_mode': 4,
        'playing_mode': 5,
        'main_volume': 6,
        'z2_power': 7,
        'z2_input': 8,
        'z2_volume': 9
        }
    PioneerConn = None

    power_on = False
    volume_level = None
    mute = None
    input_rgb_name = None
    input_mode = "0"
    listening_mode = None
    playing_mode = None
    display_text = None
    InputIdx = ("01","02","03","04","05","10","14","15","17","25","26")

#Zone 2
    Z2_power_on = False
    Z2_volume_level = None
    Z2_mute = None
    Z2_input_rgb_name = None
    Z2_input_mode = "0"
    Z2_InputIdx = ("01","02","03","04","05","10","14","15","17","25","26")

    def __init__(self):
        #self.var = 123
        return

    def onStart(self):
        Domoticz.Debug("onStart called")

        if Parameters["Mode6"] == "Debug":
            Domoticz.Debugging(1)

        InputSelections = 'Off'
        for a in self.InputIdx:
            InputSelections = InputSelections+'|'+pioneerapi.INPUT_MODES[a]
        Domoticz.Debug('LIST:'+InputSelections)
            
        SourceOptions = {'LevelActions': '|'*InputSelections.count('|'),
                              'LevelNames': InputSelections,
                              'LevelOffHidden': 'false',
                              'SelectorStyle': '1'}

        if self.UNITS['power'] not in Devices:
            Domoticz.Device(Name="Power", Unit=self.UNITS['power'], TypeName="Switch", Image=5, Used=1).Create()
        if self.UNITS['input'] not in Devices:
            Domoticz.Device(Name="Input", Unit=self.UNITS['input'], TypeName="Selector Switch", Switchtype=18, Image=5, Options=SourceOptions, Used=1).Create()
        if self.UNITS['display'] not in Devices:
            Domoticz.Device(Name="Display", Unit=self.UNITS['display'], TypeName="Text", Image=5, Used=1).Create()
        if self.UNITS['listening_mode'] not in Devices:
            Domoticz.Device(Name="Listening Mode", Unit=self.UNITS['listening_mode'], TypeName="Text", Used=1).Create()
        if self.UNITS['playing_mode'] not in Devices:
            Domoticz.Device(Name="Playing Mode", Unit=self.UNITS['playing_mode'], TypeName="Text", Used=1).Create()
        if self.UNITS['main_volume'] not in Devices:
            Domoticz.Device(Name="Volume Main Zone", Unit=self.UNITS['main_volume'], Type=244, Subtype=73, Switchtype=7, Image=8, Used=1).Create()

        #Zone 2
        Z2InputSelections = 'Off'
        for a in self.Z2_InputIdx:
            Z2InputSelections = Z2InputSelections+'|'+pioneerapi.INPUT_MODES[a]
        Domoticz.Debug('LIST:'+Z2InputSelections)

        Z2SourceOptions = {'LevelActions': '|'*Z2InputSelections.count('|'),
                            'LevelNames': Z2InputSelections,
                            'LevelOffHidden': 'false',
                            'SelectorStyle': '1'}

        if self.UNITS['z2_power'] not in Devices:
            Domoticz.Device(Name="Zone 2 Power", Unit=self.UNITS['z2_power'], TypeName="Switch", Image=5, Used=1).Create()
        if self.UNITS['z2_input'] not in Devices:
            Domoticz.Device(Name="Zone 2 Input", Unit=self.UNITS['z2_input'], TypeName="Selector Switch", Switchtype=18, Image=5, Options=Z2SourceOptions, Used=1).Create()
        if self.UNITS['z2_volume'] not in Devices:
            Domoticz.Device(Name="Volume Zone 2", Unit=self.UNITS['z2_volume'], Type=244, Subtype=73, Switchtype=7, Image=8, Used=1).Create()
        
        DumpConfigToLog()
        self.SyncDevices(1)
        self.PioneerConn = Domoticz.Connection(Name="Telnet", Transport="TCP/IP", Protocol="Line", Address=Parameters["Address"], Port=Parameters["Port"])
        self.PioneerConn.Connect()
        Domoticz.Heartbeat(30)

    def onStop(self):
        Domoticz.Log("onStop called")

    def onConnect(self, Connection, Status, Description):
        global api

        Domoticz.Debug("onConnect called")
        if Status == 0:
            self.isConnected = True
            Domoticz.Debug("Connected successfully to: "+Parameters["Address"]+":"+Parameters["Port"])
            api = pioneerapi.pioneerapi()
            self.PioneerConn.Send('\r') #Send <CR> to wake unit from stanby
            self.PioneerConn.Send(api.qry_PowerStatus, Delay=1)
            self.PioneerConn.Send(api.qry_InputStatus, Delay=2)
            self.PioneerConn.Send(api.qry_VolumeStatus, Delay=3)
            self.PioneerConn.Send(api.qry_ListeningModeStatus, Delay=4)
            self.PioneerConn.Send(api.qry_Z2_PowerStatus, Delay=5)
            self.PioneerConn.Send(api.qry_Z2_InputStatus, Delay=6)
            self.PioneerConn.Send(api.qry_Z2_VolumeStatus, Delay=7)
            wait=8
            for key in self.InputIdx:
                wait += 1
                self.PioneerConn.Send("?RGB"+str(key)+"\r", Delay=wait)
        else:
            self.isConnected = False
            self.power_on = False
            self.SyncDevices(1)
            Domoticz.Debug("Failed to connect ("+str(Status)+") to: "+Parameters["Address"]+":"+Parameters["Port"]+" with error: "+Description)
        return

    def onMessage(self, Connection, Data):
        Domoticz.Debug("onMessage called")
        self.oustandingPings = self.oustandingPings - 1
        strData = Data.decode("utf-8", "ignore")
        Domoticz.Debug("onMessage called with Data: '"+str(strData)+"'")

        strData = strData.strip()
        shaction = strData[0:2]
        shdetail = strData[2:]
        loaction = strData[0:3]
        lodetail = strData[3:]

        if loaction == 'PWR': #POWER
            if lodetail == '0': #PWR0
                self.power_on = True
                self.PioneerConn.Send(api.qry_VolumeStatus, Delay=0)
            else: #PWR1
                self.power_on = False
        elif loaction == 'VOL': #VOLUME
            self.volume_level = str(round((int(str(lodetail))*100)/185))
        elif loaction == 'MUT': #MUTE
            if lodetail == '0': #MUT0
                self.mute = 'On'
            else: #MUT1
                self.mute = 'Off'
        elif loaction == 'RGB': #INPUT NAME
            self.input_rgb_name = api.RGB_decode(str(lodetail))
            if self.input_rgb_name != None:
                Domoticz.Debug('RGB:'+self.input_rgb_name)
                InputSelections = 'Off'
                for a in self.InputIdx:
                    InputSelections = InputSelections+'|'+pioneerapi.INPUT_MODES[a]
                Domoticz.Debug('LIST:'+InputSelections)

                SourceOptions = {'LevelActions': '|'*InputSelections.count('|'),
                                'LevelNames': InputSelections,
                                'LevelOffHidden': 'false',
                                'SelectorStyle': '1'}
                Devices[self.UNITS['input']].Update(nValue = 0, sValue = "Off", Options = SourceOptions)

        elif shaction == 'FN': #INPUT            
            self.input_mode = self.selector_find(str(shdetail), 0)
            Domoticz.Debug('FN:'+str(self.input_mode))
        elif shaction == 'Z2F': #Zone 2 INPUT
            self.input_mode = self.selector_find(str(shdetail), 0)
            Domoticz.Debug('Z2F:'+str(self.input_mode))
        elif shaction == 'SR': #LISTENING MODE
            self.listening_mode = api.SR_decode(str(shdetail))
            Domoticz.Debug('SR:'+self.listening_mode)
        elif shaction == 'LM': #PLAYING LISTENING MODE
            self.playing_mode = api.LM_decode(str(shdetail))
            Domoticz.Debug('LM:'+self.playing_mode)
        elif shaction == 'FL': #DISPLAY TEXT
            self.display_text = api.FL_decode(str(shdetail))
            Domoticz.Debug('FL:'+self.display_text)
        self.SyncDevices(0)
        return

    def onCommand(self, Unit, Command, Level, Hue):
        Domoticz.Debug("onCommand called for Unit " + str(Unit) + ": Parameter '" + str(Command) + "', Level: " + str(Level))
        action, sep, params = Command.partition(' ')
        action = action.capitalize()
        params = params.capitalize()
        if Unit == self.UNITS['power']:
            if Command=='Off':
                Domoticz.Debug("Unit Power Off")
                self.PioneerConn.Send(Message=api.cmd_PowerOff, Delay=0)
                self.power_on = False
            elif Command=='On':
                Domoticz.Debug("Unit Power On")
                self.PioneerConn.Send(Message=api.cmd_PowerOn, Delay=0)
                self.power_on = True
        elif Unit == self.UNITS['main_volume']:
            if (action == "On"):
                self.PioneerConn.Send(Message='MF\r', Delay=0)
            elif (action == "Set"):
                self.volume_level = str(round((int(Level)*185)/100)).rjust(3,'0')
                self.PioneerConn.Send(Message=self.volume_level+'VL\r', Delay=0)
            elif (action == "Off"):
                self.PioneerConn.Send(Message='MO\r', Delay=0)
            Domoticz.Debug('Level:'+str(Level))
        elif Unit == self.UNITS['input']:
            if (action == "Set"):
                if Level != "0":
                    self.input_mode = self.selector_find(Level,1)
                    self.PioneerConn.Send(Message=self.input_mode+'FN\r', Delay=0)
                else:
                    self.power_on = False
                    self.PioneerConn.Send(Message=api.cmd_PowerOff, Delay=0)
        #Zone 2

        if Unit == self.UNITS['z2_power']:
            if Command=='Off':
                Domoticz.Debug("Unit Power Off")
                self.PioneerConn.Send(Message=api.cmd_Z2_PowerOff, Delay=0)
                self.power_on = False
            elif Command=='On':
                Domoticz.Debug("Unit Power On")
                self.PioneerConn.Send(Message=api.cmd_Z2_PowerOn, Delay=0)
                self.power_on = True
        elif Unit == self.UNITS['z2_volume']:
            if (action == "On"):
                self.PioneerConn.Send(Message='Z2MF\r', Delay=0) #mute on function
            elif (action == "Set"):
                self.volume_level = str(round((int(Level)*185)/100)).rjust(3,'0')
                self.PioneerConn.Send(Message=self.volume_level+'ZV\r', Delay=0)
            elif (action == "Off"):
                self.PioneerConn.Send(Message='Z2MO\r', Delay=0) #mute off function
            Domoticz.Debug('Level:'+str(Level))
        elif Unit == self.UNITS['z2_input']:
            if (action == "Set"):
                if Level != "0":
                    self.input_mode = self.selector_find(Level,1)
                    self.PioneerConn.Send(Message=self.z2_input_mode+'ZS\r', Delay=0)
            else:
                self.power_on = False
                self.PioneerConn.Send(Message=api.cmd_Z2_PowerOff, Delay=0)


    def onNotification(self, Name, Subject, Text, Status, Priority, Sound, ImageFile):
        Domoticz.Log("Notification: " + Name + "," + Subject + "," + Text + "," + Status + "," + str(Priority) + "," + Sound + "," + ImageFile)

    def onDisconnect(self, Connection):
        Domoticz.Log("onDisconnect called")
        self.isConnected = False

    def onHeartbeat(self):
        if (self.PioneerConn.Connected() == True):
            if (self.oustandingPings > 3):
                Domoticz.Debug("Ping Timeout, Disconnect")
                self.PioneerConn.Disconnect()
                self.nextConnect = 0
            else:
                self.PioneerConn.Send(Message=api.qry_PowerStatus,Delay=0)
                Domoticz.Debug("POWER STATUS Message Sent")
                self.oustandingPings = self.oustandingPings + 1
        else:
            # if not connected try and reconnected every 2 heartbeats
            self.oustandingPings = 0
            self.nextConnect = self.nextConnect - 1
            if (self.nextConnect <= 0):
                self.nextConnect = 3
                self.PioneerConn.Connect()
        return

    def SyncDevices(self, TimedOut):
        if (self.power_on == False):
            UpdateDevice(self.UNITS['power'], 0, "Off", TimedOut)
            UpdateDevice(self.UNITS['input'], 0, "0", TimedOut)
            UpdateDevice(self.UNITS['display'], 0, "", TimedOut)
            UpdateDevice(self.UNITS['listening_mode'], 0, "", TimedOut)
            UpdateDevice(self.UNITS['playing_mode'], 0, "", TimedOut)
            UpdateDevice(self.UNITS['main_volume'], 0, self.volume_level, TimedOut)
        else:
            UpdateDevice(self.UNITS['power'], 1 , "On", TimedOut)
            UpdateDevice(self.UNITS['input'], int(self.input_mode), str(self.input_mode), TimedOut)
            UpdateDevice(self.UNITS['display'], 0, self.display_text, TimedOut)
            UpdateDevice(self.UNITS['listening_mode'], 0, self.listening_mode, TimedOut)
            UpdateDevice(self.UNITS['playing_mode'], 0, self.playing_mode, TimedOut)
            UpdateDevice(self.UNITS['main_volume'],2,self.volume_level, TimedOut)
        return

    def selector_find(self, query, ctype):
            if ctype == 0:
                sel = (self.InputIdx.index(str(query))+1)*10 #Off olduğu için +1 var
                Domoticz.Debug('INDEX:'+str(sel))
            else:
                sel = self.InputIdx[int((query/10)-1)] #Off olduğu için -1 var
            return sel

global _plugin
_plugin = BasePlugin()

def onStart():
    global _plugin
    _plugin.onStart()

def onStop():
    global _plugin
    _plugin.onStop()

def onConnect(Connection, Status, Description):
    global _plugin
    _plugin.onConnect(Connection, Status, Description)

def onMessage(Connection, Data):
    global _plugin
    _plugin.onMessage(Connection, Data)

def onCommand(Unit, Command, Level, Hue):
    global _plugin
    _plugin.onCommand(Unit, Command, Level, Hue)

def onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile):
    global _plugin
    _plugin.onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile)

def onDisconnect(Connection):
    global _plugin
    _plugin.onDisconnect(Connection)

def onHeartbeat():
    global _plugin
    _plugin.onHeartbeat()

# Generic helper functions

def UpdateDevice(Unit, nValue, sValue, TimedOut):
    # Make sure that the Domoticz device still exists (they can be deleted) before updating it 
    if (Unit in Devices):
        if (Devices[Unit].nValue != nValue) or (Devices[Unit].sValue != sValue) or (Devices[Unit].TimedOut != TimedOut):
            Devices[Unit].Update(nValue=nValue, sValue=str(sValue), TimedOut=TimedOut)
            Domoticz.Log("Update "+str(nValue)+":'"+str(sValue)+"' ("+Devices[Unit].Name+")")
    return

def DumpConfigToLog():
    for x in Parameters:
        if Parameters[x] != "":
            Domoticz.Debug( "'" + x + "':'" + str(Parameters[x]) + "'")
    Domoticz.Debug("Device count: " + str(len(Devices)))
    for x in Devices:
        Domoticz.Debug("Device:           " + str(x) + " - " + str(Devices[x]))
        Domoticz.Debug("Device ID:       '" + str(Devices[x].ID) + "'")
        Domoticz.Debug("Device Name:     '" + Devices[x].Name + "'")
        Domoticz.Debug("Device nValue:    " + str(Devices[x].nValue))
        Domoticz.Debug("Device sValue:   '" + Devices[x].sValue + "'")
        Domoticz.Debug("Device LastLevel: " + str(Devices[x].LastLevel))
    return
I highly doubt that this will work flawlessly since i did not checked all, but at least it creates the devicesİ i i find some free time in the weekend i might check it out...
biggav
Posts: 7
Joined: Wednesday 02 August 2017 5:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by biggav »

Thanks heaps febalci,

that worked straight up nice work. the only bug i found is the zone 2 power feedback and input feedback are not working. do you have any ideas about this one?
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

biggav wrote: Thursday 12 April 2018 7:56 the only bug i found is the zone 2 power feedback and input feedback are not working. do you have any ideas about this one?
Nice,I can work on it in the weekend. Will let you know once it is handled...
grillmedister
Posts: 1
Joined: Saturday 23 June 2018 8:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by grillmedister »

Firstly, let me thank you for putting time and ressources into this project.
I would like to try out your plugin.

Domoticz run on Raspberry PI 3
AVR: Pioneer VSX-922K
AVR IP: 10.0.1.15
AVR Port: 8102 (this is the default for the script, not sure if I should use another one)

I've tried connecting to the AVR through telnet, this works fine.
In the past, the AVR have been connected to the standard Pioneer App, and through openHAB, with great success, so I'm pretty sure it is possible. Not sure if the problem lies within the model of my AVR or possible the port number.

I've added the plugin to domoticz and tried to connect it to my AVR. I'm note sure if the port number is correct, but it looks like it can't connect to the avr. the debug is as follows:

Code: Select all

2018-06-23 08:44:42.353 (Forstærker Stue) Started.
2018-06-23 08:44:42.481 (Forstærker Stue) Entering work loop.
2018-06-23 08:44:42.481 (Forstærker Stue) Initialized version 0.9.0, author 'febalci'
2018-06-23 08:44:42.483 (Forstærker Stue) Debug log level set to: 'true'.
2018-06-23 08:44:42.483 (Forstærker Stue) LIST:Off|CD|TUNER|CD-R/TAPE|DVD|TV/SAT|VIDEO 1|VIDEO 2|DVR/BDR|iPod/USB|BD|H.M.G.
2018-06-23 08:44:42.483 (Forstærker Stue) Creating device 'Power'.
2018-06-23 08:44:42.485 (Forstærker Stue) Creating device 'Input'.
2018-06-23 08:44:42.487 (Forstærker Stue) Creating device 'Display'.
2018-06-23 08:44:42.489 (Forstærker Stue) Creating device 'Listening Mode'.
2018-06-23 08:44:42.490 (Forstærker Stue) Creating device 'Playing Mode'.
2018-06-23 08:44:42.492 (Forstærker Stue) Creating device 'Volume Main Zone'.
2018-06-23 08:44:42.494 (Forstærker Stue) 'Key':'PioneerAVR'
2018-06-23 08:44:42.494 (Forstærker Stue) 'HardwareID':'8'
2018-06-23 08:44:42.494 (Forstærker Stue) 'Name':'Forstærker Stue'
2018-06-23 08:44:42.494 (Forstærker Stue) 'Mode6':'Debug'
2018-06-23 08:44:42.494 (Forstærker Stue) 'HomeFolder':'/home/pi/domoticz/plugins/DomoticzPioneerAVR/'
2018-06-23 08:44:42.494 (Forstærker Stue) 'Author':'febalci'
2018-06-23 08:44:42.494 (Forstærker Stue) 'Port':'8102'
2018-06-23 08:44:42.494 (Forstærker Stue) 'Version':'0.9.0'
2018-06-23 08:44:42.495 (Forstærker Stue) 'Address':'10.0.1.15'
2018-06-23 08:44:42.495 (Forstærker Stue) Device count: 6
2018-06-23 08:44:42.495 (Forstærker Stue) Device: 1 - ID: 443, Name: 'Forstærker Stue - Power', nValue: 0, sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device ID: '443'
2018-06-23 08:44:42.495 (Forstærker Stue) Device Name: 'Forstærker Stue - Power'
2018-06-23 08:44:42.495 (Forstærker Stue) Device nValue: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device LastLevel: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device: 2 - ID: 444, Name: 'Forstærker Stue - Input', nValue: 0, sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device ID: '444'
2018-06-23 08:44:42.495 (Forstærker Stue) Device Name: 'Forstærker Stue - Input'
2018-06-23 08:44:42.495 (Forstærker Stue) Device nValue: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device LastLevel: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device: 3 - ID: 445, Name: 'Forstærker Stue - Display', nValue: 0, sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device ID: '445'
2018-06-23 08:44:42.495 (Forstærker Stue) Device Name: 'Forstærker Stue - Display'
2018-06-23 08:44:42.495 (Forstærker Stue) Device nValue: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device LastLevel: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device: 4 - ID: 446, Name: 'Forstærker Stue - Listening Mode', nValue: 0, sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device ID: '446'
2018-06-23 08:44:42.495 (Forstærker Stue) Device Name: 'Forstærker Stue - Listening Mode'
2018-06-23 08:44:42.495 (Forstærker Stue) Device nValue: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device LastLevel: 0
2018-06-23 08:44:42.495 (Forstærker Stue) Device: 5 - ID: 447, Name: 'Forstærker Stue - Playing Mode', nValue: 0, sValue: ''
2018-06-23 08:44:42.495 (Forstærker Stue) Device ID: '447'
2018-06-23 08:44:42.496 (Forstærker Stue) Device Name: 'Forstærker Stue - Playing Mode'
2018-06-23 08:44:42.496 (Forstærker Stue) Device nValue: 0
2018-06-23 08:44:42.496 (Forstærker Stue) Device sValue: ''
2018-06-23 08:44:42.496 (Forstærker Stue) Device LastLevel: 0
2018-06-23 08:44:42.496 (Forstærker Stue) Device: 6 - ID: 448, Name: 'Forstærker Stue - Volume Main Zone', nValue: 0, sValue: ''
2018-06-23 08:44:42.496 (Forstærker Stue) Device ID: '448'
2018-06-23 08:44:42.496 (Forstærker Stue) Device Name: 'Forstærker Stue - Volume Main Zone'
2018-06-23 08:44:42.496 (Forstærker Stue) Device nValue: 0
2018-06-23 08:44:42.496 (Forstærker Stue) Device sValue: ''
2018-06-23 08:44:42.496 (Forstærker Stue) Device LastLevel: 0
2018-06-23 08:44:42.496 Error: (CDevice_update) Forstærker Stue - Power: Failed to parse parameters: 'nValue', 'sValue', 'SignalLevel', 'BatteryLevel' or 'Options' expected.
2018-06-23 08:44:42.496 Error: (Forstærker Stue) 'CDevice_update' failed 'TypeError':''TimedOut' is an invalid keyword argument for this function'.
2018-06-23 08:44:42.496 (Forstærker Stue) Update 0:'Off' (Forstærker Stue - Power)
2018-06-23 08:44:42.496 Error: (CDevice_update) Forstærker Stue - Input: Failed to parse parameters: 'nValue', 'sValue', 'SignalLevel', 'BatteryLevel' or 'Options' expected.
2018-06-23 08:44:42.496 Error: (Forstærker Stue) 'CDevice_update' failed 'TypeError':''TimedOut' is an invalid keyword argument for this function'.
2018-06-23 08:44:42.496 (Forstærker Stue) Update 0:'0' (Forstærker Stue - Input)
2018-06-23 08:44:42.496 Error: (Forstærker Stue) 'onStart' failed 'AttributeError':''Domoticz.Device' object has no attribute 'TimedOut''.
2018-06-23 08:44:42.496 Error: (Forstærker Stue) ----> Line 253 in /home/pi/domoticz/plugins/DomoticzPioneerAVR/plugin.py, function onStart
2018-06-23 08:44:42.496 Error: (Forstærker Stue) ----> Line 77 in /home/pi/domoticz/plugins/DomoticzPioneerAVR/plugin.py, function onStart
2018-06-23 08:44:42.496 Error: (Forstærker Stue) ----> Line 227 in /home/pi/domoticz/plugins/DomoticzPioneerAVR/plugin.py, function SyncDevices
2018-06-23 08:44:42.496 Error: (Forstærker Stue) ----> Line 288 in /home/pi/domoticz/plugins/DomoticzPioneerAVR/plugin.py, function UpdateDevice
2018-06-23 08:44:52.029 (Forstærker Stue) Calling message handler 'onHeartbeat'.
2018-06-23 08:44:52.029 Error: (Forstærker Stue) 'onHeartbeat' failed 'AttributeError':''NoneType' object has no attribute 'Connected''.
2018-06-23 08:44:52.029 Error: (Forstærker Stue) ----> Line 281 in /home/pi/domoticz/plugins/DomoticzPioneerAVR/plugin.py, function onHeartbeat
2018-06-23 08:44:52.029 Error: (Forstærker Stue) ----> Line 205 in /home/pi/domoticz/plugins/DomoticzPioneerAVR/plugin.py, function onHeartbeat
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: Pioneer AVR

Post by rednas »

febalci wrote: Thursday 21 December 2017 10:25 https://github.com/febalci/DomoticzPioneerAVR
I installed the plugin and tried using it with my VSX-933.
However I have some problems and I was wondering if you could help me out.

I receive these errors with not even doing anything:

Code: Select all

Failed to connect (110) to: 192.168.2.232:23 with error: Connection timed out

Error: CConnection_connect, connect request from 'Pioneer AVR' ignored. Transport is connecting.
and when I for example try to power on the unit, I receive these errors:

Code: Select all

2019-02-25 16:15:45.867 Status: User: *** initiated a switch command (394/Pioneer AVR - Power/On)
2019-02-25 16:15:45.916 Error: (Pioneer AVR) 'onCommand' failed 'NameError':'name 'api' is not defined'.
2019-02-25 16:15:45.916 Error: (Pioneer AVR) ----> Line 269 in '/home/pi/domoticz/plugins/Pioneer-AVR/plugin.py', function onCommand
2019-02-25 16:15:45.916 Error: (Pioneer AVR) ----> Line 176 in '/home/pi/domoticz/plugins/Pioneer-AVR/plugin.py', function onCommand
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

rednas wrote: Monday 25 February 2019 16:16
febalci wrote: Thursday 21 December 2017 10:25 https://github.com/febalci/DomoticzPioneerAVR
I installed the plugin and tried using it with my VSX-933.
However I have some problems and I was wondering if you could help me out.

I receive these errors with not even doing anything:

Code: Select all

Failed to connect (110) to: 192.168.2.232:23 with error: Connection timed out

Error: CConnection_connect, connect request from 'Pioneer AVR' ignored. Transport is connecting.
and when I for example try to power on the unit, I receive these errors:

Code: Select all

2019-02-25 16:15:45.867 Status: User: *** initiated a switch command (394/Pioneer AVR - Power/On)
2019-02-25 16:15:45.916 Error: (Pioneer AVR) 'onCommand' failed 'NameError':'name 'api' is not defined'.
2019-02-25 16:15:45.916 Error: (Pioneer AVR) ----> Line 269 in '/home/pi/domoticz/plugins/Pioneer-AVR/plugin.py', function onCommand
2019-02-25 16:15:45.916 Error: (Pioneer AVR) ----> Line 176 in '/home/pi/domoticz/plugins/Pioneer-AVR/plugin.py', function onCommand
I am not so sure if vsx933 supports telnet connection; if yes from which port? From the messages it is obvious that it does not support port 23, have you tried 8102?
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: Pioneer AVR

Post by rednas »

Port 8102 gives an error 111: connection refused
Port 23 gives an error 110: connection timed out

So actually it looks like there is a difference! Is there something else I could do wrong?
I am not able to find out whether it supports telnet actually..
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Pioneer AVR

Post by febalci »

rednas wrote: Tuesday 26 February 2019 10:04 Port 8102 gives an error 111: connection refused
Port 23 gives an error 110: connection timed out

So actually it looks like there is a difference! Is there something else I could do wrong?
I am not able to find out whether it supports telnet actually..
Dear rednas,

I found it interesting that there is nearly no documents or information for connection types on web for VSX-933. But also, since it is not listed under supported for the smartphone app icontrolav5 https://play.google.com/store/apps/deta ... trolav2014, i assume your av does not support any telnet connections at all. As far as i know Pioneer was using Telnet connections for older models only. So it won't be possible for you to use this plugin for VSX-933 :( . Sorry...
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: Pioneer AVR

Post by rednas »

Too bad, however strange that it responds different to port 8102 and 23...
I can find out that the VSX-933 supports Control4 control, so there must be a possibility to control it I would say. However, I can't find out how :?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest