Home Theatre Controller (Pioneer AVR + USB PowerMate)

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Looks like a good thing:

Code: Select all

pi@domoticz ~/htc $ sudo ./server.js
Pioneer: connected
POWER: true
INPUT: 5
VOLUME: 40
^CExiting...
And in Domoticz i see in the log:

Code: Select all

2016-02-04 23:20:29.641 User: Admin initiated a switch command
2016-02-04 23:20:29.642 (Dummy) Lighting 2 (VSX Volume)
2016-02-04 23:20:31.875 User: Admin initiated a switch command
2016-02-04 23:20:31.876 (Dummy) Lighting 2 (VSX Volume)
2016-02-04 23:20:33.430 User: Admin initiated a switch command
2016-02-04 23:20:33.431 (Dummy) Light/Switch (VSX Input)
2016-02-04 23:20:37.835 User: Admin initiated a switch command
2016-02-04 23:20:37.837 (Dummy) Light/Switch (VSX Input)
2016-02-04 23:20:38.987 Hardware Monitor: Fetching data (System sensors)
2016-02-04 23:20:41.719 User: Admin initiated a switch command
2016-02-04 23:20:41.720 (Dummy) Light/Switch (VSX Input)
Tomorrow i go furter, bit late now.
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

I dont see a
Domoticz MQTT: connected
line in your logs, this indicates you dont have the MQTT Interface setup..

Code: Select all

apt-get install mosquitto
then in Domoticz add a new hardware type: MQTT and tell it to connect to localhost, then you should be cooking.

Image

sample log of success:

Code: Select all

Starting domoticz-htc daemon...
Pioneer: connected
Domoticz MQTT: connected
POWER: false
INPUT: 15
DOMO:{"Battery":255,"RSSI":12,"dtype":"Light/Switch","id":"000140E0","idx":145,"name":"TV","nvalue":0,"stype":"Selector Switch","svalue1":"0","switchType":"Selector","unit":1}
DOMO: {"Battery":255,"RSSI":12,"dtype":"Light/Switch","id":"00014107","idx":184,"name":"Outdoor Speakers","nvalue":0,"stype":"Selector Switch","svalue1":"0","switchType":"Selector","unit":1}
DOMO: Tuner Power Off
DOMO: {"Battery":255,"RSSI":12,"dtype":"Light/Switch","id":"00014109","idx":186,"name":"FM Tuner","nvalue":0,"stype":"Selector Switch","svalue1":"0","switchType":"Selector","unit":1}
VOLUME: 40
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Crazy MQTT was installed. Will give it a try later this day. :)
But we are getting there
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Stiil have no connection to MQTT

Code: Select all

2016-02-05 13:06:05.259 MQTT: Connecting to localhost:1883
2016-02-05 13:06:05.362 MQTT: connected to: localhost:1883
2016-02-05 13:06:05.463 MQTT: Subscribed

Code: Select all

domoticz-htc daemon stopped.
pi@domoticz ~/htc $ ./server.js
AVR: got connection.
Pioneer: connected
AVR data: R
AVR: true
POWER: true
domoticz/in: {"command":"addlogmessage","message":"<HTC> Home Theatre is powering up..."}
AVR data: PWR0
AVR input: 05 : undefined
INPUT: 5
AVR listening mode: EXTENDED STEREO
AVR: volume 35%
VOLUME: 35
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

post up your config.js file pls
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Code: Select all

 GNU nano 2.2.6                     File: config.js

// DOMOTICZ-HTC Example Configuration
// rename to config.js after making your changes.
// All Configuration options are made here, wont be overwritten on update.

// BEGIN CONFIG
var options = {
        powermate       : false,                // Enable PowerMate Volume Knob
        sharptv         : false,                // Enable SharpTV Sync & OSD
        host            : 'localhost',          // MQTT Broker Host (Domoticz)
        avrPort         : 8102,                 // Dedicated Telnet port on Pioneer
        avrHost         : "192.168.2.42",       // IP Address of Pioneer
        maxvol          : 161,                  // 0dB, issue telnet: 3SUD for hard enforcment.
        tvPort          : "/dev/ttyUSB-TV",     // Serial Port for TV
        idx             : [ ],                  // Init IDX Array
        request         : false,                // Required for MQTT
        status          : 'htc/connected',      // MQTT Status Path
        syslog          : false,                // Log to Syslog
        log             : true,         // Extra Debug Logging
};

// Domoticz Switches - NAME : IDX (false = Disabled)
var switches = {
        inputs          : 116,                  // Input Selector Switch (Required)
        modes           : 117,                  // Mode Selector Switch
        volume          : false,                // Volume Dimmer
        zone2           : false,                // Zone2 Input Selector
        z2volume        : false,                // Zone2 Volume Slider
        zone3           : false,                // Zone3 Input Selector
        z3volume        : false,                // Zone3 Volume Slider
        zone4           : false,                // Zone4 Input Selector
        tuner           : false,                // AM/FM Tune Selector
        displayText     : 115,          // Front Display Text
        modeText        : false,                        // Audio Mode Text
        lights          : false,                        // Lights to dim w/PowerMate
};

// See your Pioneer IP & RS-232 Control Commands doc for Input and Audio Mode Numbers.

// Domoticz Input Selector - LEVEL : [INPUT, NAME]
var inputs = {
        0               : [ 0, 'Power Off' ],
        10              : [ 15, 'Nexus Player' ],
        20              : [ 04, 'PlayStation 3' ],
        30              : [ 22, 'PlayStation 4' ],
        40              : [ 24, 'Security Cameras' ],
        50              : [ 02, 'FM Tuner' ],
};
// Domoticz Audio Mode Selector - LEVEL : [MODE, NAME]
var modes = {
        10              : [ '0006', 'Auto Surround' ],
        20              : [ '0151', 'Auto Level Control' ],
        30              : [ '0007', 'Stream Direct' ],
        40              : [ '0001', 'Stereo' ],
        50              : [ '0012', 'ProLogic' ],
        60              : [ '0014', 'ProLogic Music' ],
        70              : [ '0112', 'Extended Stereo'],
};

// Domoticz Zone2/3/4 Input Selector - LEVEL : [INPUT, NAME]
var zoneInputs = {
        0               : [ 0, 'Power Off' ],
        10              : [ 15, 'Nexus Player' ],
        20              : [ 02, 'FM Tuner' ],
        30              : [ 41, 'Native Pandora' ],
        40              : [ 44, 'AirPlay' ],
};

// Domoticz Radio Tuner Selector - LEVEL : [FREQ, NAME]
var radio = {
        0               : [ 0, 'Power Off' ],
        10              : [ '09010', '90.1 NPR' ],
        20              : [ '09410', '94.1 KOA' ],
        30              : [ '09330', '93.3 KCTL' ],
        40              : [ '10150', '101.5 Jammin' ],
        50              : [ '10670', '106.7 KBPI' ],
        60              : [ '10550', '105.5 Jack' ],
}
// END CONFIG

exports.options = options
exports.switches = switches
exports.inputs = inputs
exports.modes = modes
exports.zoneInputs = zoneInputs
exports.radio = radio


User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

what version of mosquitto do you have?

Code: Select all

$ apt-cache show mosquitto
Package: mosquitto
Version: 1.3.4-2
you might try using the version from here: http://mosquitto.org/2013/01/mosquitto- ... epository/

apparently I need to get me a RPI to do testing with..
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Crazy thing somehow port 1883 was occupiet?!


Code: Select all

pi@domoticz ~ $ mosquitto
1454680761: mosquitto version 1.4.7 (build date Tue, 22 Dec 2015 12:47:28 +0000) starting
1454680761: Using default config.
1454680761: Opening ipv4 listen socket on port 1883.
1454680761: Error: Address already in use
pi@domoticz ~ $ mosquitto -p 1884
1454680780: mosquitto version 1.4.7 (build date Tue, 22 Dec 2015 12:47:28 +0000) starting
1454680780: Using default config.
1454680780: Opening ipv4 listen socket on port 1884.
1454680780: Opening ipv6 listen socket on port 1884.
1454680780: Warning: Address family not supported by protocol
1454680792: New connection from 192.168.2.110 on port 1884.
1454680792: New client connected from 192.168.2.110 as root.1454680790802 (c1, k60).
1454680836: New connection from 127.0.0.1 on port 1884.
1454680836: New client connected from 127.0.0.1 as mosq/>TWZk9M0VZRdiGR3`_ (c1, k60).
1454680922: New connection from 127.0.0.1 on port 1884.
1454680922: New client connected from 127.0.0.1 as mqttjs_efa0b9f5 (c1, k10).

Code: Select all

pi@domoticz ~/htc $ nano config.js
pi@domoticz ~/htc $ ./server.js
AVR: got connection.
Pioneer: connected
AVR data: R
Domoticz MQTT: connected
Domoticz MQTT: connected
domoticz/in: {"command":"addlogmessage","message":"<HTC> Home Theatre Controller connected."}
domoticz/in: {"command":"getdeviceinfo","idx":false}
AVR: true
POWER: true
domoticz/in: {"command":"addlogmessage","message":"<HTC> Home Theatre is powering up..."}
AVR data: PWR0
AVR input: 05 : undefined
INPUT: 5
AVR listening mode: EXTENDED STEREO
AVR: volume 13%
VOLUME: 13
AVR listening mode: EXTENDED STEREO
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Back to port 1883

Edited the config file again and it looks it is working now. Still after a reboot :)

Code: Select all


// BEGIN CONFIG
var options = {
        powermate       : false,                // Enable PowerMate Volume Knob
        sharptv         : false,                // Enable SharpTV Sync & OSD
        host            : 'localhost:1883',             // MQTT Broker Host (Domoticz)
        avrPort         : 8102,                 // Dedicated Telnet port on Pioneer
        avrHost         : "192.168.2.42",       // IP Address of Pioneer
        [b]maxvol          : 1070, [/b]                // 0dB, issue telnet: 3SUD for hard enforcment.
        tvPort          : "/dev/ttyUSB-TV",     // Serial Port for TV
        idx             : [ ],                  // Init IDX Array
        request         : false,                // Required for MQTT
        status          : 'home/pi/domoticz',   // MQTT Status Path
        syslog          : false,                // Log to Syslog
        log             : true,         // Extra Debug Logging
};

// Domoticz Switches - NAME : IDX (false = Disabled)
var switches = {
        inputs          : 116,                  // Input Selector Switch (Required)
        modes           : 117,                  // Mode Selector Switch
        volume          : 111,          // Volume Dimmer
        zone2           : false,                // Zone2 Input Selector
        z2volume        : false,                // Zone2 Volume Slider
        zone3           : false,                // Zone3 Input Selector
        z3volume        : false,                // Zone3 Volume Slider
        zone4           : false,                // Zone4 Input Selector
        tuner           : false,                // AM/FM Tune Selector
        displayText     : 100,          // Front Display Text
        modeText        : 115,                  // Audio Mode Text
        lights          : false,                        // Lights to dim w/PowerMate
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

thats was very odd, glad you figured that out because I would have been running in circles... but it looks like your finally up and working yay.

id suggest putting log back to false, thats like extra verbose mode right now and alot of redundant information.. you will still get logs with it disabled, just not so much of it.

Ive got syslog enabled and it logging to /var/log/htc.log so I can see what its doing while running in background, useful for troubleshooting ultra-rare bugs.. you can find more info in: https://github.com/nayrnet/domoticz-htc ... /rsyslog.d
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Odd indeed but i think the Key was 'localhost:1883' in the config file.

Did put the logging off, no furter need for it.

My VSX dont have a switch on from the network (WOL) so i hope it can handle it, the connection back.
Everything is working now! GREAT JOB!

One little thing the volume slider works but the mute function not completly.
Its sends a mute on, my vsx sees that but my vsx tells its not muted so it put it back off again and that in a second.

Is it hard to get a volume slider or buttons for the subwoofer pre-out -12-+12?

Still need to write a manual for the wife ;)
And mayb to get her crazy to buy a new pioneer somewhere this year
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

your going to need to disable the volume slider right now, its broken.. I been working with devs to get what I need into the beta but I am not quite there yet.. looks like next stable domoticz is coming at the end of the month so I better get cracking on it.

I'll let you know once I got the volume fully functional and you should just be able to update and add that back into your config.

I will look to see if changing volume on sub is doable, I have my system all MCACC self-tuned so I tend not to mess with it as it does pretty damn good as is... my sub is pretty big and can get out of hand pretty quickly without decent equalizer settings.
Last edited by nayr on Friday 05 February 2016 17:21, edited 1 time in total.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

ok there are commands I can use to change bass level, but its per input setting.. I dont think it would work well.

I propose this alternative: MCACC MEMORY SET, I've got 6 memory settings I can store various speaker configurations in.. If you want a high bass or low bass setting just save it into a memory slot and I can have a selector choose between them with a default each time its powered on.

ie, I could copy my self tuned MCACC memory to an empty slot, manually edit it to detune the subwoofer and increase the volume on the center channel for dialog, and get a pretty decent night mode.. or a party mode where bass is up a little bit so there is still enough bass left when all speakers are running and volume is set low enough to allow for conversations.

Does your Pioneer support MCACC Memory?
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

Great, i only use one MCACC but my wife and i can't agree about the sub setting. Normal i use only between -3 and +3.
Its all what is playing and at what volume. movie, episode or music and at wich volume. The -12 and +12 is indeed to big and it will do some damage if it is not used right. :)
A movie we do +3, a epesode at 00, -3 for some very loud music, but +3 for low volume.

Mayb i will have a look at the MCACC settings just like the light scene's but now Audio scenes and there wil be always a remote for the last settings.

How big is the problem with the volume slider? From what i can see its working great only the mute funtion and the remote/vsx is a bit lagy because they cant agree fast enought.
Last edited by HNBC84 on Friday 05 February 2016 17:46, edited 1 time in total.
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

the vsx920 does have 6 MCACC slots too :)
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

the problem with the dummy sliders was it was a mere 15 steps from 0-100%, and I coded against a switch that I customized to have 100 steps between 0-100%.. I submitted my custom switch to the repo but it was rejected and Gizmo started finishing up work on an existing switch that was supposed to have these features.

what version of domoticz are you running? maby they made it in, Ive been busy this week and havent been paying that much attention since last time I updated.. was planing on making progress on it this weekend, but it could well be done already.

If thats the case then yeah, it probably works mostly except the mute function.. that was a separate switch at the last point I was working on it.. should be an easy fix.. the disagreement your seeing though could be a symptom of the broken slider, does it have 100 steps or only a few? does anything over 15% register as 100%? I am not sure how it would behave with the original dummy slider because I did not code against it..
Last edited by nayr on Friday 05 February 2016 18:17, edited 2 times in total.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HNBC84
Posts: 63
Joined: Tuesday 01 December 2015 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by HNBC84 »

V2.4389

Don't think they did, still junps about 6 or 7%. But it is working for me. A 100 steps would be better.
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

my math takes the 121-181 steps from the receiver (depending on where max volume is set, I suggest 0db which is 161 steps and puts normal volume at about the 50% mark) and translates it into percentages from 0-100. The dummy slider in Domoticz was seeking numerical input between 0-15, so thats where it was broken and where I've been working on getting a change in the main domoticz branch.

I would urge you to set that to false at this point and just leave that switch dangling until Ive got this addressed, I would hate for you to damage your speakers because the volume landed at a level you did not instruct it to go to. (rounding up 7% could get really ugly)

these are also the kinda switches you might consider protecting with a password to prevent misclicks, this is not a volume up button that will only change it slowly when someone sits on it.. this can go to 100% in an instant and that can be bad for your speakers, hearing and WAF.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
steppi
Posts: 41
Joined: Saturday 30 January 2016 0:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by steppi »

Thanks so much! Now my mistake is more beautiful: D
Unfortunately still it does not work:

Code: Select all

pi@domoticz:~/htc $ ./server.js
FATAL AVR ERROR: Error: connect ECONNREFUSED
Domoticz MQTT: connected
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Home Theatre Controller (Pioneer AVR + USB PowerMate)

Post by nayr »

steppi, your getting a Connection Refused back from your Pioneer.. this can either be because something is already connected to it (another HTC instance, android remote, etc) or your receiver is simply not listening on that port.

check your network setup directly on your AVR, Mine lets me configure multiple port numbers and I have one dedicated to HTC.. I think you will have the same capability.. but HNBC84 can only use port 21 as his does not support multiple listening ports

it should match the following line in your config.js

Code: Select all

	avrPort: 	50000,			// Dedicated Telnet port on Pioneer
that 50000 is the port I use and only an example, I believe the example config uses port 23 as its typically the default.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest