As discussed in the lirc rpi gpio IR support for picoreplayer thread, this place is intended for discussion of a comprehensive solution for the task of triggering IR commands in response to player events. Based on the conceptual work of ahebrank, I've written a small daemon in Micropython that gets the current player ID from the server by player name (instead of hardcoding the MAC address) and then listens for events affecting that player.

Currently, only power 0 and power 1 are supported, but this could easily extended to mixer volume <value>. Indeed, I've tested the CLI with my player and with the VolumeLock plugin enabled, I still get the mixer volume events like this:

Code:
<playerid> mixer volume 95
<playerid> mixer volume 100
<playerid> mixer volume 90
<playerid> mixer volume 100
<playerid> mixer volume 85
<playerid> mixer volume 100
<playerid> mixer volume 80
<playerid> mixer volume 100
<playerid> mixer volume 105
This means that every volume change is followed by an immediate reset to the fixed level. Accounting for that and translating these to a number of steps should be possible (and will be my next task).

Currently, the daemon is configured by a JSON file (for which the path must be given as the first argument on the command line). It allows multiple IR commands per triggering event, with customizable delay between them, but the syntax is not very flexible. Here's an example configuration file:

Code:
{
	"IRSEND": "/usr/local/bin/irsend",
	"REMOTE": "<LIRCDRemote>",
	"EVENTS": {
		"POWER_ON": [
			{
				"DELAY": 0,
				"CODE": "<Command1>"
			},
			{
				"DELAY": 1000,
				"CODE": "<Command2>"
			}
		],
		"POWER_OFF": [
			{
				"DELAY": 0,
				"CODE": "<Command3>"
			}
		]
	},
	"SERVER": {
		"HOST": "<HostName>",
		"PORT": 9090,
		"RESTART_DELAY": 30
	},
	"PLAYER_NAME": "<PlayerName>"
}
I'd like to make integration into pCP as easy as possible - is there a way to get the set player name from the command line, so that it does not have to be configured explicitly? Anything else to think of?