Legrand Nuvo multi-room audio support

Yep, looks like you’re right, Brian. I get this in the logs.

2022-10-10 16:33:49.571 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nuvo_simple which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-10-10 16:33:55.670 INFO (Thread-2 (_listen)) [nuvo_simple] Attempting connection - "socket://192.168.1.26:59001" at 9600 baud
2022-10-10 16:33:55.686 ERROR (SyncWorker_4) [custom_components.nuvo_simple] Error opening serial port
2022-10-10 16:33:55.686 ERROR (Thread-2 (_listen)) [nuvo_simple] Could not open serial port.
File "/usr/local/lib/python3.10/site-packages/nuvo_simple/__init__.py", line 627, in _listen
2022-10-10 16:33:55.700 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration nuvo_simple: Integration failed to initialize.

I tried to Telnet to the port on the RPi and can’t get a connection. I rechecked the config files and it all aligns with yours. The only thing I really changed was the port name. From your instructions, I used the full port name which for me is usb-FTDI_FT232R_USB_UART_AB0MDF75-if00-port0. I set up the nuvonet file as follows:

#!/bin/bash
export PORT=usb-FTDI_FT232R_USB_UART_AB0MDF75-if00-port0
stty -F $PORT cs8 -cstopb -parenb -crtscts 9600
ncat --listen --keep-open localhost 59001 < $PORT > $PORT

I even tried the full path name for the PORT like this:

PORT=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0MDF75-if00-port0

Didn’t make any difference.

I know the cable is good as I’ve used it in another integration and it works fine.

Am I doing anything above that’s obviously wrong?

Hi again. Some further experimentation led me to try pyserial, which works on my Russound amp. That allowed me to Telnet to the RPi and send commands to the Nuvo and it actually works. I.e. I can send a zone ON command and the zone turns on. When I use pyserial to connect to your integration, I get the following in the logs:

2022-10-10 18:12:02.541 INFO (Thread-2 (_listen)) [nuvo_simple] Attempting connection - "socket://192.168.1.26:1337" at 9600 baud
2022-10-10 18:12:02.559 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:03.663 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:04.767 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:05.758 WARNING (MainThread) [homeassistant.config_entries] Config entry '192.168.1.4' for yamaha_musiccast integration not ready yet; Retrying in background
2022-10-10 18:12:05.870 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:06.972 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:08.074 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:09.177 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:10.279 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:11.381 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:12.484 DEBUG (SyncWorker_2) [nuvo_simple] Sending "VER"
2022-10-10 18:12:12.536 WARNING (MainThread) [homeassistant.setup] Setup of nuvo_simple is taking over 10 seconds.
2022-10-10 18:12:13.586 ERROR (SyncWorker_2) [nuvo_simple] This does not appear to be a supported Nuvo device.
2022-10-10 18:12:13.589 ERROR (SyncWorker_2) [custom_components.nuvo_simple] This does not appear to be a supported Nuvo device.
2022-10-10 18:12:13.590 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration nuvo_simple: Integration failed to initialize.

So I think I can conclude that my cable works, the RPi works and the Nuvo connection works but for some reason I can’t get your setup to work either with ncat or pyserial. Hopefully this gives you some clues?

Hi again. Some further experimentation led me to try pyserial, which works on my Russound amp. That allowed me to Telnet to the RPi and send commands to the Nuvo and it actually works. I.e. I can send a zone ON command and the zone turns on. When I use pyserial to connect to your integration, I get the following in the logs:

That’s awesome! Sounds like you are close.
Hmmm, one is I noticed is you changed the port from the first run from 59001 to 1337 on the socket connection. That’s totally fine as long as ncat is running on port 1337 now as well, which means you would have changed the 59001 to 1337 in the shell script.

The PORT setting needs to be the full device to the serial port, so you were correct in putting the whole thing there. If you were running the “nuvonet” as a service, you would need to run “systemctl restart nuvonet” after modifying the shell script for the new setting to take effect.

So, I assume things work fine when you telnet to port 1337 and you can send commands to the Nuvo. I don’t know what you’re running on the RPi to make this happen though. Is it ncat or something else?

For the time being, until I find a few days of spare time, you’re going to have to use ncat to make this work. Using something else more than likely will not as it won’t support two connections at the same time.

I used pyserial (here) to telnet on port 1337 to send serial commands. It just happens that it was configured for port 1337 so that’s what I used. NCAT doesn’t work for me. Can’t telnet to it. I used your 59001 port for that. I used two different SD cards to make sure nothing got messed up.

I installed pyserial using these instructions, if you of a mind to try it out. I don’t know if it supports two connections you mention.

I installed pyserial using these instructions, if you of a mind to try it out. I don’t know if it supports two connections you mention.

I just tried this and unfortunately it does not work. If you run the shell script for ncat manually, does it give you any errors that might point to where the problem would be?

I performed the following. It just sits there after the last line. I can’t telnet to port 59001.
ncat

1 Like

I really screwed up here! I made a mistake and copied an old line I tried when updating the documentation. Just remove “localhost” from the command and it should work fine. Sorry about that!

Haha. No worries. These things happen. Unfortunately, it still doesn’t work for me. My script now looks like this:

#!/bin/bash
export PORT=/dev/serial/by-id/FTDI_FT232R_USB_UART_AB0MDF75-if00-port0
stty -F $PORT cs8 -cstopb -parenb -crtscts 9600
ncat --listen --keep-open 59001 < $PORT > $PORT

I still can’t Telnet to port 59001.

Wait up! I just realised a screw-up in the naming of the port in these latest edits. Too many copy/pastes. I changed that and we have some progress. I can now Telnet to the port. If I type in *VER, it responds with #MPU_E6v1.09. I can send commands via Telnet like turning on a zone and the Nuvo turns on the zone. So the comms is working between the Nuvo and the RPi. That’s progress! I then went into HA and restarted it. Now the logs return:

2022-10-12 08:36:18.237 INFO (Thread-2 (_listen)) [nuvo_simple] Attempting connection - "socket://192.168.1.26:59001" at 9600 baud
2022-10-12 08:36:18.253 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:19.355 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:20.458 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:21.560 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:21.848 WARNING (MainThread) [homeassistant.config_entries] Config entry '192.168.1.4' for yamaha_musiccast integration not ready yet; Retrying in background
2022-10-12 08:36:22.667 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:23.771 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:24.874 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:25.976 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:27.079 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:28.181 DEBUG (SyncWorker_1) [nuvo_simple] Sending "VER"
2022-10-12 08:36:28.223 WARNING (MainThread) [homeassistant.setup] Setup of nuvo_simple is taking over 10 seconds.
2022-10-12 08:36:29.284 ERROR (SyncWorker_1) [nuvo_simple] This does not appear to be a supported Nuvo device.
2022-10-12 08:36:29.287 ERROR (SyncWorker_1) [custom_components.nuvo_simple] This does not appear to be a supported Nuvo device.
2022-10-12 08:36:29.288 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration nuvo_simple: Integration failed to initialize.

I left Telnet open and I can see multiple responses of #MPU_E6v1.09. It seems that the RPi is getting the messages but for some reason, HA isn’t getting the responses? Or isn’t understanding the responses? At least we’re making progress. I feel like we’re close.

Ok, maybe I have it figured out now, after taking several machines to the Nuvo and plugging in the serial port. You need to add “raw” to the end of the stty command. I will update the documentation. On some models of USB adapters I used, it would not work until I put that in there. Another key thing is you should see everything on a single line on the telnet session. These Nuvos do not send a newline character, so if you see everything scrolling up the screen, it’s not going to work, as something is adding one.

You should see in the debug logs “Received:” messages with every packet it sees.

Furthermore, the version MPU-E6 was not programmed to work. The protocol docs and mine issue a MPU-E6D. I will update the program integration in a few minutes to handle this. You should see an option to upgrade in HACS. Let me know how it goes!

1 Like

I’m really sorry, Brian. You’re right. Mine does in fact respond with #MPU-E6Dv1.09. I wasn’t paying enough attention. Sorry to have made extra work for you. I’ll try your suggestion re: adding raw to the stty command and report back.

It needs to go before the 9600. Just check the README file on github for an example.

SUCCESS!!! That was it, Brian. I added the ‘raw’ to the stty command, updated your integration in HA, restarted and BOOM. No errors and I could create a dashboard with all the zones being controlled. So far, everything seems to be working. I’ll give it more of a workout but for now, it all looks good.

Thank you for your perseverance and work on this! Hopefully our trials save others some effort to get it working. I’ll no doubt come back and seek your counsel once again as I play around with setting up some more advanced dashboards but at least it’s all working now! I owe you a beer or three. Let me know if you ever find yourself in Brisbane, Australia and I’ll meet you at the pub. :beers:

1 Like

Just adding to this, you’re absolutely right. Until I added the ‘raw’ to stty, the telnet session was showing a bunch of weird indents, suggesting that there were carriage returns in there. Now looking at telnet, everything is on the one line. I think you nailed it.

I’m glad it’s working! That network serial port thing was something I never even thought of before but it makes sense that many people would not have a HA server right beside the Nuvo. I’m sure our work willl pay off if anyone else wants to use the network. Would love to visit Australia sometime, that’s for sure. Everyone I’ve ever talked to down that way is so friendly!

I’ll put some more examples and stuff on github this week. I need to do some work on my own dashboards as well. One thing I would like to do is have the controls for the currently selected source be the only ones that show up for a room dashboard. Should be pretty easy to do but I haven’t got around to it yet.

1 Like

That would be fabulous. The example you have on there at the moment looks great and I’ve finally figured out what to do with it (still very much a HA noob), so have a test dashboard implementing one zone with your example. I really like it and has given me impetus to keep playing around with it. I have a lot to learn, so any examples are really appreciated. It’ll save me endless searching and experimenting.

It sounds like you’re in the northern hemisphere then? Your name suggests you’re of Irish origin but the Irish are all over the world, so not necessarily where you live.

1 Like

Nice! Sounds like you’ve got a good working set up for speaker groups now and even have volume offsets working.

I’ve done a complete rework of the speaker group implementation. After trying to make use of Nuvo groups (which only syncs source changes) I decided to remove this and just make speaker groups a pure HA thing as it was becoming very very messy! Way too many state checks needed done and with async operations making timing of events unclear it was hard to reason about so I scrapped it :-1: . Wish I’d gone this route originally as it’s much simpler now, but when the system offers a feature like that, you think why not use it :man_shrugging:

Downside is groups are temporary and lost across HA restarts, but that’s not a biggie and can easily be recreated at startup with a service call.

Upside is it now supports multiple speaker groups.

In order to support a physical zone with keypad as group controller, I’ve lost the ability to determine if a volume change was a volume set or a volume up/down operation, everything is just a volume state change now, so no more doing a volume up on the controller and having that do the same on a group member and maintain any local offset. Local offsets are still possible by altering member volume, but any controller volume change will resync the volumes. I’ve not done anything on configurable volume offsets, need to take a look at how you’ve handled it.

1 Like

Version v2.0.0 is now available in HACS.

Upgrading from v1.2.2

Recommend to remove then reinstall the integration for reasons detailed in this post Legrand Nuvo multi-room audio support - #102 by sprocket-9

Upgrading from v2.0.0-beta.1

Installing over the beta version will work fine.

1 Like

I am running the latest HAOS on an RPi with HACS installed and the 2.0.0 version of this custom integration installed and connected to an NV-E6G. My Nuvo system isn’t used much, so it is frequently sleeping. Because of this, I get an error anytime I try to turn it on. If I correctly remember previously reading this thread, the fix I am replying to is for that (or a similar) issue. However, since the issue was known and addressable prior to some subsequent updates, and possibly because I read (or dreamed) that it was called out as fixed, I thought maybe that issue was one of the fixes in Legrand Nuvo multi-room audio support - #88 by sprocket-9 or v2, so I didn’t want to attempt this fix if I may be looking at a different issue. To be clear, I basically get an error like this when trying to turn on a zone, but I can successfully turn on any zone afterwards:

Failed to call service media_player/turn_on.
RESPONSEREADER: Timeout waiting for response to message: *Z2ON

The 2 in “*Z2ON” is the zone number in this example, so it varies depending on which zone I am trying to turn on, and I won’t see the error again until all zones have been off for a while, so between that and the fact that I can get the error for any zone, but only once at a given time, I am confident that the issue is related to the Nuvo sleeping.

Is this fix for that, and if so, is it still applicable to v2? Otherwise, is there something else I might have missed or anything I should try to work around or help diagnose/troubleshoot my issue?