From 12143634883204007796fc5af64988b1e46f3579 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Wed, 4 Dec 2024 22:19:19 +0100 Subject: [PATCH 01/10] Add eiscp_sender command The eiscp_sender command is essentially the same as the eiscp_monitor command, except that it exits after 1 second. This allows for sending a command to test (and probably capture a response) without having to kill the eiscp_monitor afterwards. --- pyeiscp/tools.py | 13 ++++++++++++- setup.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pyeiscp/tools.py b/pyeiscp/tools.py index 5b17099..1bf9237 100644 --- a/pyeiscp/tools.py +++ b/pyeiscp/tools.py @@ -2,13 +2,14 @@ import argparse import asyncio import logging +import time import pyeiscp __all__ = ("console", "monitor") -async def console(loop, log): +async def console(loop, log, timeout=False): """Connect to receiver and show events as they occur. Pulls the following arguments from the command line (not method arguments): @@ -54,6 +55,9 @@ def connect_callback(host): for message in args.messages: conn.send(message) + if timeout: + await asyncio.sleep(timeout) + loop.stop() def monitor(): @@ -62,3 +66,10 @@ def monitor(): loop = asyncio.get_event_loop() asyncio.ensure_future(console(loop, log)) loop.run_forever() + +def sender(): + """Wrapper to call console with a loop that stops after 2 seconds""" + log = logging.getLogger(__name__) + loop = asyncio.get_event_loop() + asyncio.ensure_future(console(loop, log, timeout=1)) + loop.run_forever() diff --git a/setup.py b/setup.py index 9cc07fc..2ca71d7 100644 --- a/setup.py +++ b/setup.py @@ -33,5 +33,5 @@ def readme(): "netifaces", ], zip_safe=True, - entry_points={"console_scripts": ["eiscp_monitor = pyeiscp.tools:monitor",]}, + entry_points={"console_scripts": ["eiscp_monitor = pyeiscp.tools:monitor","eiscp_sender = pyeiscp.tools:sender",]}, ) From e21925181f429116f8ed2bde9e49f27d1c678cb3 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Wed, 4 Dec 2024 22:28:21 +0100 Subject: [PATCH 02/10] Add multiroom-status query command Add the 'MDI QSTN' command, which is used on Onkyo receivers to query what multiroom audio "groups" this receiver is participating in. This is the info in the "edit group" feature in the Onkyo app in the tripple-dot menu. Also known as FlareConnect. --- README.rst | 7 +++++++ pyeiscp/commands.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/README.rst b/README.rst index d1db29c..85cc7f2 100644 --- a/README.rst +++ b/README.rst @@ -75,6 +75,13 @@ your receiver and its configured port: eiscp_monitor --host 10.0.0.100 --port 60128 +A secondary command line tool allows for easy sending of commands to +the receiver. For example, to query the multiroom audio status ("groups") +on an Onkyo receiver: + +:: + + eiscp_sender --host 10.0.0.100 'multiroom-status query' Credits ------- diff --git a/pyeiscp/commands.py b/pyeiscp/commands.py index 44b85cb..69789be 100644 --- a/pyeiscp/commands.py +++ b/pyeiscp/commands.py @@ -17,6 +17,13 @@ 'description': 'gets the System Power Status'})]), 'name': 'system-power', 'description': 'System Power Command'}), + ('MDI', { + 'values': OrderedDict([ + ('QSTN', {'name': 'query', 'description': 'query the multiroom zones status'}), + ]), + 'name': 'multiroom-status', + 'description': 'Get details on the multiroom zones this device is a part of' + }), ('AMT', {'values': OrderedDict([('00', {'name': 'off', 'description': 'sets Audio Muting Off'}), ('01', {'name': 'on', 'description': 'sets Audio Muting On'}), @@ -2343,6 +2350,7 @@ 'source': 'SLI', 'battery-charge-status': 'BCS', 'system-power': 'PWR', + 'multiroom-status': 'MDI', 'dialog-control-enabled': 'DCE', 'current-folder-status-no': 'CFS', 'xm-category': 'XCT', @@ -3428,6 +3436,7 @@ 'b-xx': 'B{xx}', 'query': 'QSTN', 't-xx': 'T{xx}'}, + 'MDI': {'query': 'QSTN'}, 'PNR': {'on': '01', 'toggle': 'TG', 'off': '00', 'query': 'QSTN'}, 'MCC': {'query': 'QSTN', '00': '00', '01': '01'}, 'ARC': {'auto': '01', 'off': '00', 'up': 'UP', 'query': 'QSTN'}, From 59bd8789cf9c31af7bc2894e1dc45f525b5c4dce Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Sun, 15 Dec 2024 12:09:03 +0100 Subject: [PATCH 03/10] Add raw-message command Add the raw-message command 'MGS', which can be used on Onkyo receivers to set up multiroom audio (aka Flareconnect) --- pyeiscp/commands.py | 11 ++++++++++- pyeiscp/protocol.py | 17 +++++++++++++---- pyeiscp/utils.py | 11 +++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/pyeiscp/commands.py b/pyeiscp/commands.py index 69789be..6bbc3df 100644 --- a/pyeiscp/commands.py +++ b/pyeiscp/commands.py @@ -5,7 +5,7 @@ # at 2019-06-16 18:16:40.906934 from collections import OrderedDict -from .utils import ValueRange +from .utils import ValueRange, RawMessage COMMANDS = OrderedDict([('main', OrderedDict([('PWR', {'values': OrderedDict([('00', {'name': ('standby', 'off'), @@ -24,6 +24,13 @@ 'name': 'multiroom-status', 'description': 'Get details on the multiroom zones this device is a part of' }), + ('MGS', { + 'values' : OrderedDict([ + ('', {'name': '', 'description': 'some xml formatted message'}) + ]), + 'name': 'raw-message', + 'description': 'Send a pre-formatted message to the receiver, Onkyo devices use this for setting up multiroom audio (flareconnect)' + }), ('AMT', {'values': OrderedDict([('00', {'name': 'off', 'description': 'sets Audio Muting Off'}), ('01', {'name': 'on', 'description': 'sets Audio Muting On'}), @@ -2351,6 +2358,7 @@ 'battery-charge-status': 'BCS', 'system-power': 'PWR', 'multiroom-status': 'MDI', + 'raw-message': 'MGS', 'dialog-control-enabled': 'DCE', 'current-folder-status-no': 'CFS', 'xm-category': 'XCT', @@ -3437,6 +3445,7 @@ 'query': 'QSTN', 't-xx': 'T{xx}'}, 'MDI': {'query': 'QSTN'}, + 'MGS': {RawMessage(''): ''}, 'PNR': {'on': '01', 'toggle': 'TG', 'off': '00', 'query': 'QSTN'}, 'MCC': {'query': 'QSTN', '00': '00', '01': '01'}, 'ARC': {'auto': '01', 'off': '00', 'up': 'UP', 'query': 'QSTN'}, diff --git a/pyeiscp/protocol.py b/pyeiscp/protocol.py index b45f516..12747c1 100644 --- a/pyeiscp/protocol.py +++ b/pyeiscp/protocol.py @@ -5,7 +5,7 @@ import struct import re from pyeiscp import commands -from pyeiscp.utils import ValueRange +from pyeiscp.utils import ValueRange, RawMessage from collections import namedtuple __all__ = "AVR" @@ -177,7 +177,7 @@ def command_to_iscp(command, arguments=None, zone=None): if arguments is None and zone is None: # Separating command and args with colon allows multiple args if ":" in command or "=" in command: - base, arguments = re.split(r"[:=]", command, 1) + base, fullarguments = re.split(r"[:=]", command, 1) parts = [norm(c) for c in re.split(command_sep, base)] if len(parts) == 2: zone, command = parts @@ -185,7 +185,7 @@ def command_to_iscp(command, arguments=None, zone=None): zone = default_zone command = parts[0] # Split arguments by comma or space - arguments = [norm(a) for a in re.split(r"[ ,]", arguments)] + arguments = [norm(a) for a in re.split(r"[ ,]", fullarguments)] else: # Split command part by space or dot parts = [norm(c) for c in re.split(command_sep, command)] @@ -229,6 +229,14 @@ def command_to_iscp(command, arguments=None, zone=None): # We need to send the format "FF", hex() gives us 0xff value = hex(int(argument))[2:].zfill(2).upper() break + else: + if isinstance(possible_arg, RawMessage): + # This is a raw string message that we should just pass as-is to the receiver + if fullarguments: + value = fullarguments + else: + value = argument + break # TODO: patterns not yet supported else: @@ -338,7 +346,8 @@ def command(self, command, arguments=None, zone=None): self.log.error(f"Invalid message. {error}") return - self.log.debug("> %s", command) + self.log.debug("> command: %s", command) + self.log.debug("> iscp_message: %s", iscp_message) try: self.transport.write(command_to_packet(iscp_message)) except: diff --git a/pyeiscp/utils.py b/pyeiscp/utils.py index 91dc351..599b934 100644 --- a/pyeiscp/utils.py +++ b/pyeiscp/utils.py @@ -1,3 +1,4 @@ +import string class ValueRange(object): """Some command values are defined as a range of possible values, such as from 1 to 100. We use a custom type to represen @@ -14,3 +15,13 @@ def __init__(self, start, end): def __contains__(self, value): return value in self._range + +class RawMessage(object): + """Some command values are plain strings that get send as-is. + For now we use this for the MSG message type, used on Onkyo + receivers for setting up multi-room audio (flareconnect). + """ + def __init__(self, content): + self.content = content + # currently not used, but we might want to check messages for having valid chars + self.allowedchars = string.printable From 51faba906a2fd1c8273fffeba3f10cd69221ff70 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Tue, 17 Dec 2024 13:33:45 +0100 Subject: [PATCH 04/10] Add multiroom audio example to Readme Added a crude example for starting&stopping multiroom audio (aka flareconnect) on two Onkyo devices. --- README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 85cc7f2..71e1925 100644 --- a/README.rst +++ b/README.rst @@ -83,6 +83,23 @@ on an Onkyo receiver: eiscp_sender --host 10.0.0.100 'multiroom-status query' +The eiscp_sender command can also be used to enable/disable multiroom audio +aka (flareconnect). For this you will need the mac address of the secondary +device, you can obtain this from the field returned from the +'multiroom-status query' command. To start a multiroom audio group with +10.0.0.100 (0123456DDEEFF) as the host, and 012356AABBCC as secondary device: + +:: + + eiscp_sender --host 10.0.0.100 'raw-message=1500' + +To stop this grouping: + +:: + + eiscp_sender --host 10.0.0.100 'raw-message=0' + + Credits ------- From 5148db8b659d272a500f156a0c77e429723a7ee9 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Wed, 1 Jan 2025 11:25:36 +0100 Subject: [PATCH 05/10] Add a writeup on how to create start/stop buttons for multiroom audio in home assistant --- Onkyo-homeassistant-flareconnect.rst | 105 +++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Onkyo-homeassistant-flareconnect.rst diff --git a/Onkyo-homeassistant-flareconnect.rst b/Onkyo-homeassistant-flareconnect.rst new file mode 100644 index 0000000..2e4aaf6 --- /dev/null +++ b/Onkyo-homeassistant-flareconnect.rst @@ -0,0 +1,105 @@ +Onkyo audio groups in home assistant +==================================== + +This is a crude guide on how to set up Onkyo flareconnect (aka multiroom audio / audio groups) with home assistant. For this we will replace the python-eiscp (pyeiscp) module used by the Onkyo integration in home assistant with a modified version. You can find the details on this modded version here: https://github.com/rlKoekie/python-eiscp/tree/onkyo-groups . The goal here is to create two simple buttons on your home assistant dashboard for easily starting and stopping the Onkyo audio group setup. + +My own instance is a Home Assistant OS, running under libvirt on linux (virsh). Things might be slightly different depending on your own setup (e.g. docker). In these cases you will need to make sure you connect to the right docker container command line. +You will of course need two (or more) Onkyo devices with multiroom audio support (flareconnect), you can use the “Onkyo Controller” app on android ( https://play.google.com/store/apps/details?id=com.onkyo.jp.onkyocontroller ) to check and test this, or you can just YOLO it. The app has this feature under “edit group”. + +Preparations +------------ + +Home Assistant installed addons: +- Advanced SSH & Web Terminal (protection mode is disabled, might not be needed) +- File editor + +I am assuming that you already have your onkyo hardware configured under the home assistant “devices” under settings. + +To make your own life a lot easier, you should configure your onkyo devices to have a fixed IP address. This is done in your router settings, usually in the DHCP configuration part. + +Installation +------------ + +First we will install the modified python-eiscp module and then try the commands in the terminal, that makes it easier to debug things. After this we will define aliasses for the commands in the configuration yaml file, and create two buttons on the dashboard. Try to copy-paste the commands, it is very easy to make a mistake in the order of single quotes, brackets, double quotes and slashes. Stuff will not work if you mistype them. + +- Open up your HA terminal. This should show you a bash shell with a bunch of text and a $ sign. Welcome to Linux! If this is all new for you, you might want to read up a bit first about command lines, or you can just hope I included all needed steps in this writeup :-) Home Assistant is quite cleverly set up, with the actual homeassistant running in a virtual (docker) environment. So the shell we are in now, is not the same place as where things are executing when we use home assistant the normal way. So we first need to get into the docker environment. Run the following command to get in: + +:: + + docker exec -it homeassistant /bin/bash + +This will change your shell to something like: “homeassistant:/config#”, indicating you are now inside the “homeassistant” docker container, in folder “/config”, as “root” user (the # symbol). Now install the modified python-eiscp package with the following command: + +:: + + pip install -I git+https://github.com/rlKoekie/python-eiscp.git@onkyo-groups + +This should print some interesting text, and at the end there should be a line reading “Successfully installed netifaces-0.11.0 pyeiscp-0.0.7”. Feel free to ignore any warnings about running pip as ‘root’. This step will most likely have to be repeated when you update home assistant! I hope that the Onkyo plugin for home assistant itself will get the changes I made to python-eiscp integrated at some point, that will remove the need for these command line moves. + +Now we are ready to test! Let’s see if we can talk to our Onkyo devices. Run the following command, after changing the IP address (the 10.0.0.100 part) to the address of your own onkyo hardware (you wrote that down right?) + +:: + + eiscp_sender --host 10.0.0.100 'multiroom-status query' + +This spits back some info about your Onkyo device. Write down the 0123456DDEEFF somewhere (you can select it in the terminal, and then copy it with your right mouse button), repeat for your other Onkyo device(s). + +Now we create the grouping command. It should look something like this: + +:: + + /usr/local/bin/eiscp_sender --host 10.0.0.100 'raw-message=1500' + +Make sure to: +- Change the 10.0.0.100 IP address into the IP address of your main Onkyo device (the one sharing its audio to the secondary devices). +- Change 0123456DDEEFF into the mac address of the main (sending) onkyo device +- Change 012356AABBCC into the mac address of the secondary (receiving) onkyo device. (you can also setup multiroom audio with more than two devices, just repeat the block with the mac address for another secondary onkyo device. +If you run the moddified command on the homeassistant docker shell, it should change your onkyo devices to run in flareconnect mode. Congratulations! + +You can stop the audio grouping by telling the main device to switch to an empty audio group. The command should look something like this: + +:: + + /usr/local/bin//eiscp_sender --host 10.0.0.100 'raw-message=0' + +Make sure to change the IP address to your own main (sending) device IP! + +If everything works: nice! +- Copy the full commands you executed to start and stop the audio grouping to a text file. +- Shut down the docker terminal by typing “exit” and hitting enter +- Shut down the home assistant terminal by again typing “exit” and hitting enter + + +Now use the file editor to modify your /homeassistant/configuration.yaml +Add the following section: + +:: + + shell_command: + stop_flareconnect: /usr/local/bin//eiscp_sender --host 10.0.0.100 'raw-message=0' + start_flareconnect: /usr/local/bin/eiscp_sender --host 10.0.0.100 'raw-message=1500' + +Of course make sure to change the start and stop commands to the ones you succesfully used in the terminal app! + +After these changes to configuration.yaml, restart homeassistant (settings > system > top right menu > reboot) and wait for HA to return. + +Now we are going to create the buttons on your home assistant dashboard: +- Go to settings > devices and services > select the “helpers” tab at the top +- Hit the “create helper” button on the bottom right, select “button” +- Give the button a name (e.g. “start flareconnect button”, and find a nice icon (e.g. mdi:speaker-multiple ) +- Repeat to create a second button, now for “stop flareconnect button” +- Go to your home assistant dashboard, hit the “edit” button on the top right +- Select “by entities” at the top, and search for the name of your button (e.g. “flareconnect”). Select both, and proceed. Click on “add to dashboard”. +Now edit each button with the following: +- Appearance> Give it a name, tick the “Name” box, disable the “status” box. +- Interactions> behaviour: run action (my translation might be off, my instance is in Dutch). +- Action: Shell command: start_flareconnect (or stop_flareconnect for the stop button). +- Hit “Save”. +Select the “done editing” button on your dashboard (top right), and test your new buttons. + +Problems? +--------- + +So your new stuff is not working? The first step is to go back to the docker command line, and try your commands again. If these work, then make sure to check for typos in the configuration.yaml file. +Now go check the home assistant log files: Settings > system > logs > 3-dot menu > Show full log. Maybe there are some hints in there. + From 2cd4b2b4506b2e92efb392194951854c397e2066 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Wed, 1 Jan 2025 11:27:04 +0100 Subject: [PATCH 06/10] attempt at fixing the rst makeup --- Onkyo-homeassistant-flareconnect.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Onkyo-homeassistant-flareconnect.rst b/Onkyo-homeassistant-flareconnect.rst index 2e4aaf6..ab59c97 100644 --- a/Onkyo-homeassistant-flareconnect.rst +++ b/Onkyo-homeassistant-flareconnect.rst @@ -51,9 +51,11 @@ Now we create the grouping command. It should look something like this: /usr/local/bin/eiscp_sender --host 10.0.0.100 'raw-message=1500' Make sure to: + - Change the 10.0.0.100 IP address into the IP address of your main Onkyo device (the one sharing its audio to the secondary devices). - Change 0123456DDEEFF into the mac address of the main (sending) onkyo device - Change 012356AABBCC into the mac address of the secondary (receiving) onkyo device. (you can also setup multiroom audio with more than two devices, just repeat the block with the mac address for another secondary onkyo device. + If you run the moddified command on the homeassistant docker shell, it should change your onkyo devices to run in flareconnect mode. Congratulations! You can stop the audio grouping by telling the main device to switch to an empty audio group. The command should look something like this: @@ -65,6 +67,7 @@ You can stop the audio grouping by telling the main device to switch to an empty Make sure to change the IP address to your own main (sending) device IP! If everything works: nice! + - Copy the full commands you executed to start and stop the audio grouping to a text file. - Shut down the docker terminal by typing “exit” and hitting enter - Shut down the home assistant terminal by again typing “exit” and hitting enter @@ -84,17 +87,21 @@ Of course make sure to change the start and stop commands to the ones you succes After these changes to configuration.yaml, restart homeassistant (settings > system > top right menu > reboot) and wait for HA to return. Now we are going to create the buttons on your home assistant dashboard: + - Go to settings > devices and services > select the “helpers” tab at the top - Hit the “create helper” button on the bottom right, select “button” - Give the button a name (e.g. “start flareconnect button”, and find a nice icon (e.g. mdi:speaker-multiple ) - Repeat to create a second button, now for “stop flareconnect button” - Go to your home assistant dashboard, hit the “edit” button on the top right - Select “by entities” at the top, and search for the name of your button (e.g. “flareconnect”). Select both, and proceed. Click on “add to dashboard”. + Now edit each button with the following: + - Appearance> Give it a name, tick the “Name” box, disable the “status” box. - Interactions> behaviour: run action (my translation might be off, my instance is in Dutch). - Action: Shell command: start_flareconnect (or stop_flareconnect for the stop button). - Hit “Save”. + Select the “done editing” button on your dashboard (top right), and test your new buttons. Problems? From a124b3f03b9ba580fbc909e152882f1b9f39b3e1 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Wed, 1 Jan 2025 11:31:34 +0100 Subject: [PATCH 07/10] attempt at fixing the rst makeup --- Onkyo-homeassistant-flareconnect.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Onkyo-homeassistant-flareconnect.rst b/Onkyo-homeassistant-flareconnect.rst index ab59c97..64b8c22 100644 --- a/Onkyo-homeassistant-flareconnect.rst +++ b/Onkyo-homeassistant-flareconnect.rst @@ -22,7 +22,7 @@ Installation First we will install the modified python-eiscp module and then try the commands in the terminal, that makes it easier to debug things. After this we will define aliasses for the commands in the configuration yaml file, and create two buttons on the dashboard. Try to copy-paste the commands, it is very easy to make a mistake in the order of single quotes, brackets, double quotes and slashes. Stuff will not work if you mistype them. -- Open up your HA terminal. This should show you a bash shell with a bunch of text and a $ sign. Welcome to Linux! If this is all new for you, you might want to read up a bit first about command lines, or you can just hope I included all needed steps in this writeup :-) Home Assistant is quite cleverly set up, with the actual homeassistant running in a virtual (docker) environment. So the shell we are in now, is not the same place as where things are executing when we use home assistant the normal way. So we first need to get into the docker environment. Run the following command to get in: +Open up your HA terminal. This should show you a bash shell with a bunch of text and a $ sign. Welcome to Linux! If this is all new for you, you might want to read up a bit first about command lines, or you can just hope I included all needed steps in this writeup :-) Home Assistant is quite cleverly set up, with the actual homeassistant running in a virtual (docker) environment. So the shell we are in now, is not the same place as where things are executing when we use home assistant the normal way. So we first need to get into the docker environment. Run the following command to get in: :: @@ -34,7 +34,9 @@ This will change your shell to something like: “homeassistant:/config#”, ind pip install -I git+https://github.com/rlKoekie/python-eiscp.git@onkyo-groups -This should print some interesting text, and at the end there should be a line reading “Successfully installed netifaces-0.11.0 pyeiscp-0.0.7”. Feel free to ignore any warnings about running pip as ‘root’. This step will most likely have to be repeated when you update home assistant! I hope that the Onkyo plugin for home assistant itself will get the changes I made to python-eiscp integrated at some point, that will remove the need for these command line moves. +This should print some interesting text, and at the end there should be a line reading “Successfully installed netifaces-0.11.0 pyeiscp-0.0.7”. Feel free to ignore any warnings about running pip as ‘root’. + +**This ``pip install`` step will most likely have to be repeated when you update home assistant! I hope that the Onkyo plugin for home assistant itself will get the changes I made to python-eiscp integrated at some point, that will remove the need for these command line moves.** Now we are ready to test! Let’s see if we can talk to our Onkyo devices. Run the following command, after changing the IP address (the 10.0.0.100 part) to the address of your own onkyo hardware (you wrote that down right?) From 1b3f5f56950a0bfc7190842bf9f838b333712eb5 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Wed, 1 Jan 2025 11:33:49 +0100 Subject: [PATCH 08/10] attempt at fixing the rst makeup --- Onkyo-homeassistant-flareconnect.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Onkyo-homeassistant-flareconnect.rst b/Onkyo-homeassistant-flareconnect.rst index 64b8c22..9a59bf5 100644 --- a/Onkyo-homeassistant-flareconnect.rst +++ b/Onkyo-homeassistant-flareconnect.rst @@ -36,7 +36,7 @@ This will change your shell to something like: “homeassistant:/config#”, ind This should print some interesting text, and at the end there should be a line reading “Successfully installed netifaces-0.11.0 pyeiscp-0.0.7”. Feel free to ignore any warnings about running pip as ‘root’. -**This ``pip install`` step will most likely have to be repeated when you update home assistant! I hope that the Onkyo plugin for home assistant itself will get the changes I made to python-eiscp integrated at some point, that will remove the need for these command line moves.** +**This "pip install" step will most likely have to be repeated when you update home assistant! I hope that the Onkyo plugin for home assistant itself will get the changes I made to python-eiscp integrated at some point, that will remove the need for these command line moves.** Now we are ready to test! Let’s see if we can talk to our Onkyo devices. Run the following command, after changing the IP address (the 10.0.0.100 part) to the address of your own onkyo hardware (you wrote that down right?) From be447ccde740a7616bbe700eb17ec3c9dfa56840 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Fri, 26 Jun 2026 20:36:39 +0200 Subject: [PATCH 09/10] Attempt to fix the monitor and sender functions for working with the changes to asyncio in python 3.14 --- pyeiscp/tools.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pyeiscp/tools.py b/pyeiscp/tools.py index 1bf9237..41737d7 100644 --- a/pyeiscp/tools.py +++ b/pyeiscp/tools.py @@ -59,17 +59,18 @@ def connect_callback(host): await asyncio.sleep(timeout) loop.stop() - def monitor(): """Wrapper to call console with a loop.""" log = logging.getLogger(__name__) - loop = asyncio.get_event_loop() - asyncio.ensure_future(console(loop, log)) - loop.run_forever() + async def main(): + loop = asyncio.get_running_loop() + await console(loop, log) + asyncio.run(main()) def sender(): """Wrapper to call console with a loop that stops after 2 seconds""" log = logging.getLogger(__name__) - loop = asyncio.get_event_loop() - asyncio.ensure_future(console(loop, log, timeout=1)) - loop.run_forever() + async def main(): + loop = asyncio.get_running_loop() + await console(loop, log, timeout=1) + asyncio.run(main())` From 2059b055c0be254d774f1d07133a782ae54cd951 Mon Sep 17 00:00:00 2001 From: Hans van Schoot Date: Fri, 26 Jun 2026 20:39:50 +0200 Subject: [PATCH 10/10] Attempt to fix the monitor and sender functions for working with the changes to asyncio in python 3.14, v2 because of a typo --- pyeiscp/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyeiscp/tools.py b/pyeiscp/tools.py index 41737d7..5650532 100644 --- a/pyeiscp/tools.py +++ b/pyeiscp/tools.py @@ -73,4 +73,4 @@ def sender(): async def main(): loop = asyncio.get_running_loop() await console(loop, log, timeout=1) - asyncio.run(main())` + asyncio.run(main())