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

Post Reply
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 »

Excuse me, I pasted the wrong code ... Look now, I have modified
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 »

Code: Select all

inputs          : 145,                  // Input Selector Switch (Required)
vs

Code: Select all

inputs          : 5,                  // Input Selector Switch (Required)
the current line is incorrect, you need to replace 145 with 5, the IDX of your Domoticz Selector Switch.. as seen in your screenshot.
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 »

Ok, now INPUT works great !!
I tried to add "Volume - Dimmer" ..
It works, but as soon restart "server.js" the volume is locked: VOLUME: 16 (-67db)
Where can I change the Minimum Volume?

I have a Samsung TV, you have some settings on my TV?
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 Domoticz are you running? volume dimmer requires a very recent version.

I dont have any command codes for Samsung, for the most part you wont need them if you have full HDMI CEC Support.. my TV only has partial support, no volume or auto return channel, nor can my AVR power on my TV, but my TV can power on my AVR.. so it works one way partially.. my TV control basically just turns the TV on and off based upon the Pioneer's status.. I also hijack my TV's volume OSD, but I believe newer Pioneer's such as yours provide there own volume OSD overlay.
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 »

@HNBC84, try updating and see if it handles your AVR powering on and off better now.

in your domoticz log you should see: <HTC> AVR CONNECTION CLOSED. reconnecting in 10s
followed sometime later by program exiting with <HTC> AVR ERROR: ENOTFOUND

and then it'll be up to your cron script to bring it up.
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 »

nayr wrote:@HNBC84, try updating and see if it handles your AVR powering on and off better now.

in your domoticz log you should see: <HTC> AVR CONNECTION CLOSED. reconnecting in 10s
followed sometime later by program exiting with <HTC> AVR ERROR: ENOTFOUND

and then it'll be up to your cron script to bring it up.
Did do a git pull, going to test it, i let you know

Code: Select all

crontab -e
[i]Add this line:[/i]
5 * * * * /home/htc/daemon.js start
Write out and exit
crontab: installing new crontab
Cronjob is now starting over and over again i think. Bit crazy because my VSX is just on.

Code: Select all

2016-02-09 14:04:56.764 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:04:56.987 MQTT MSG: input changed to I-TV
2016-02-09 14:06:37.878 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
2016-02-09 14:09:56.972 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:09:57.195 MQTT MSG: input changed to I-TV
2016-02-09 14:14:56.778 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:14:56.999 MQTT MSG: input changed to I-TV
2016-02-09 14:16:38.814 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
2016-02-09 14:19:57.048 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:19:57.271 MQTT MSG: input changed to I-TV
2016-02-09 14:24:57.025 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:24:57.246 MQTT MSG: input changed to I-TV
2016-02-09 14:26:39.337 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
2016-02-09 14:29:56.806 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:29:57.028 MQTT MSG: input changed to I-TV
2016-02-09 14:34:56.804 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:34:57.025 MQTT MSG: input changed to I-TV
2016-02-09 14:36:39.893 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
2016-02-09 14:39:56.810 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:39:57.032 MQTT MSG: input changed to I-TV
2016-02-09 14:44:56.814 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:44:57.037 MQTT MSG: input changed to I-TV
2016-02-09 14:46:40.650 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
2016-02-09 14:49:56.822 MQTT MSG: Home Theatre is powering up...
2016-02-09 14:49:57.044 MQTT MSG: input changed to I-TV
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 »

ah no those MQTT logs are normal, I guess I should change the wording so its less confusing..

every 10m, HTC queries the power state of the receiver.. it needs to do this to detect if the AVR has dropped off the network without closing the connection correctly, without some periodic activity the AVR can go away and HTC wont realize it until the next time you try to do something with it.
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 »

nayr wrote:What version of Domoticz are you running? volume dimmer requires a very recent version.

I dont have any command codes for Samsung, for the most part you wont need them if you have full HDMI CEC Support.. my TV only has partial support, no volume or auto return channel, nor can my AVR power on my TV, but my TV can power on my AVR.. so it works one way partially.. my TV control basically just turns the TV on and off based upon the Pioneer's status.. I also hijack my TV's volume OSD, but I believe newer Pioneer's such as yours provide there own volume OSD overlay.
2016-02-09 21:15:14.842 Domoticz V2.4513 (c)2012-2016 GizMoCuz
I upgraded to the latest version of Domoticz, but still does not work the volume dimmer. It works but it has a minimum too low .. Where do I find the parameters - minimum - maximum volume?
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 »

there is no minimum volume parameter, it goes all the way down to mute..

Does your dimmer say Type: Light/Switch, Switch, Dimmer like this:
Screen Shot 2016-02-09 at 1.22.16 PM.png
Screen Shot 2016-02-09 at 1.22.16 PM.png (25.54 KiB) Viewed 2702 times
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 »

Yes, I set as dimmer .. below screenshot:
volumedimmer.jpg
volumedimmer.jpg (147.89 KiB) Viewed 2697 times
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 important part im looking for is the: Light/Switch, Switch device, the previous hardware came up as Lighting2, Switch or something similar.

It was limited to 16 steps (0-15) so I suspect your dummy switch is the wrong type, and thats why you cant get past 16%..

If you created the hardware first then upgraded Domoticz to the new version with support I think you'll need to delete the existing switch and create a new one to get it to be the correct type.
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 »

@HNBC84, I did a bit more work on your scenario.. now if the connection is refused or host not found the service should retry connecting every 30s, this should give you a pretty decent recovery time once you turn the receiver on manually.. instead of 5mins for the cronjob to restart it.

If you would test this well for me I would appreciate it, I have moved off TCP and onto RS232.. so far so good, everything seems to work smoother with less hiccups.. I think flow control really helps the powermate from flooding the sockets and resulting in misreads.. I am suggesting it for anyone looking to implement the powermate hardware.

now it wont die when the AVR drops off the network, it will just hammer it twice a min until it comes back.. the it'll refresh domoticz upon connection.

also cleaned up my logging within domoticz.

new option added:

Code: Select all

	defaultVolume	: 45,			// Default Volume (%) on Input Change
also now if you specify a string for avrPort it will try to use that string to connect via Serial connection and avrHost will be ignored.. ie:

Code: Select all

	avrPort: 	"/dev/ttyUSB-AVR",	// Serial Port or TCP Port of Pioneer
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 »

@steppi - I added a check in the latest version that makes sure the Volume Dimmer is the correct type or else it throws an error and ignores any volume changes from domoticz.. this is a safety check to make sure your using the correct hardware.

and to anyone whom cares, here is a simple lua script if you want to do things on an input change:
https://github.com/nayrnet/domoticz-scr ... ice_tv.lua
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 »

nayr perfect! Now everything works perfectly! The volume is great!
Now I would like to perfect the scenes:
I would like a scene like this:
- Turn Pioneer
- Select Kodi (input)
- Volume to 50% (for example)
- Accnedi Samsung TV (we can also do it with HDMI-CEC - I work there ..)
- Turn off the lights (Philips hue - ok..quello works)
If I try to add a scene I do not have the possibility to decide which inputs to select ..
screenshot:
scene.jpg
scene.jpg (169.66 KiB) Viewed 2658 times
Thanks for everything! and greetings from Italy, here today it's sunny !!
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 have to accomplish that via Blocky or Lua script, Scenes dont support selector switches at this time.

I provided a lua script above for setting audio modes depending on what input is being used.. you could do something similar with that.

If you really want a scene I think the work around is to create a single dummy switch give it a name starting with a $ to hide it, add it to your scene, and use its on/off state to trigger an event script to perform your actions.. then a Z-Wave scene controller could activate the scene or you can do it manually with the button.
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 »

That's right you could make a script ..
Ok we do it? I would not know how to do .. There is an already compiled script where we can put our commands?
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 »

nayr wrote:@HNBC84, I did a bit more work on your scenario.. now if the connection is refused or host not found the service should retry connecting every 30s, this should give you a pretty decent recovery time once you turn the receiver on manually.. instead of 5mins for the cronjob to restart it.

If you would test this well for me I would appreciate it, I have moved off TCP and onto RS232.. so far so good, everything seems to work smoother with less hiccups.. I think flow control really helps the powermate from flooding the sockets and resulting in misreads.. I am suggesting it for anyone looking to implement the powermate hardware.

now it wont die when the AVR drops off the network, it will just hammer it twice a min until it comes back.. the it'll refresh domoticz upon connection.

also cleaned up my logging within domoticz.

new option added:

Code: Select all

	defaultVolume	: 45,			// Default Volume (%) on Input Change
also now if you specify a string for avrPort it will try to use that string to connect via Serial connection and avrHost will be ignored.. ie:

Code: Select all

	avrPort: 	"/dev/ttyUSB-AVR",	// Serial Port or TCP Port of Pioneer
Great job man!

Code: Select all

But now:
2016-02-10 16:02:46.826 MQTT MSG: [HTC] ERROR: Wrong Switch Type - VSX Volume

DOMO ERROR: Wrong Switch Type - VSX Volume
VOLUME: 37
Fixt it with a new dummy switch
VSX Volume Light/Switch Switch Off, Level: 100 %
And deleted my:
VSX Volume Light/Switch Selector Switch Set Level: 36 %, Level: 36 %
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 »

Me happy :)

I use the VSX online ping switch to do a extra control if we are home or not.
It sucks when your alone and your battery is dead from the phone and domoticz think we are not home and turn everything off. :lol:
Attachments
homem.png
homem.png (129.68 KiB) Viewed 2639 times
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 »

ah well good thing I checked that, perhaps I should check all the switches to make sure they are the right type..

How is it doing recovering from your AVR dropping off the network and coming back?

Looks good, you should be able to setup Zone 2 now if you like..

Look at the GeoFencing apps, if you have decent GPS coverage in your house it works better.. but I use a combination of Geofencing, Pinging and each of our devices to decide if the house is really empty or not.. its not perfect but Im working on it.

Are you using Zwave? I wonder if something like a Z-Wave lamp module with load sensing might give you the ability to power on/off.

Looks like your running a KodiPlayer on a RPi, you might take a hard look at the AndroidTV Nexus Player, its a great lil Kodi box and you can root it.. I got mine for like $50 and use a OTG Ethernet.. you get android app support and thats really nice.. I run plex and the native launcher but you can replace the google launcher with Kodi and go right into it.. comes with a bluetooth remote and voice search.

Ive been trying to get the Domoticz Android apps to take on the AndroidTV UI.. no love so far but I might just do it my self
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 »

Found a bit of a problem...

It goes everytime back to ALC :( most of the time i have it on ext.stereo beacause the beamer and 7.1 speaker system is 90 degrees of the TV ;)

Code: Select all

2016-02-10 16:34:50.247 MQTT: Topic: domoticz/in, Message: {"command":"udevice","idx":100,"nvalue":0,"svalue":"EXT.STEREO"}
2016-02-10 16:34:50.362 MQTT: Topic: domoticz/in, Message: {"command":"udevice","idx":115,"nvalue":0,"svalue":"EXTENDED STEREO"}
2016-02-10 16:35:01.228 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:35:31.286 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:36:01.344 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:36:31.403 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:37:01.462 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:37:20.320 (RFXtrx433) Temp + Rain (Unknown)
2016-02-10 16:37:31.510 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:38:01.570 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:38:31.629 Hardware Monitor: Fetching data (System sensors)
2016-02-10 16:38:44.966 MQTT: Topic: domoticz/in, Message: {"command":"addlogmessage","message":"[HTC] Pioneer AVR is ON"}
2016-02-10 16:38:44.966 MQTT MSG: [HTC] Pioneer AVR is ON
2016-02-10 16:38:45.066 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":117,"switchcmd":"Set Level","level":10}
2016-02-10 16:38:45.068 (Dummy) Light/Switch (VSX Sound Modus)
2016-02-10 16:38:45.181 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":116,"switchcmd":"Set Level","level":"20"}
2016-02-10 16:38:45.182 (Dummy) Light/Switch (VSX Input)
2016-02-10 16:38:45.296 MQTT: Topic: domoticz/in, Message: {"command":"addlogmessage","message":"[HTC] Input changed to I-TV"}
2016-02-10 16:38:45.296 MQTT MSG: [HTC] Input changed to I-TV
2016-02-10 16:38:45.396 MQTT: Topic: domoticz/in, Message: {"command":"udevice","idx":100,"nvalue":0,"svalue":"ALC"}
2016-02-10 16:38:45.508 MQTT: Topic: domoticz/in, Message: {"command":"udevice","idx":115,"nvalue":0,"svalue":"STEREO"}
2016-02-10 16:38:50.267 MQTT: Topic: domoticz/in, Message: {"command":"udevice","idx":100,"nvalue":0,"svalue":"STEREO"}
2016-02-10 16:39:01.689 Hardware Monitor: Fetching data (System sensors)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest