Legrand Nuvo multi-room audio support

Ok thanks. All I could glean from sprocket-9’s config is to possibly replace the ‘port:’ in your config with a URL in the form ‘socket://host:port’ where ‘host’ is the IP address of the Ethernet to Serial adapter and ‘port’ is the port configured on the Ethernet to Serial adapter.

I’ll give that a try and see what I get. After that, I’m a bit lost sadly.

Look forward to seeing the progress you’ve made with the speaker groups! Great work.

Ok thanks. All I could glean from sprocket-9’s config is to possibly replace the ‘port:’ in your config with a URL in the form ‘socket://host:port’ where ‘host’ is the IP address of the Ethernet to Serial adapter and ‘port’ is the port configured on the Ethernet to Serial adapter.

Sproket-9’s has a good guide on the config file needed for the ser2net program. You would need to install this on the Pi and then put the correct serial port in the config, and change it from 57600 to 9600 baud.

However, I tested this, and while I can get a connection to my Nuvo just fine by telnetting to the port, there is a problem with the way I wrote the integration. It opens the port twice, once for read, and once for write. While this works just fine on a normal serial port, it does not work using a network socket, as it can only be opened a single time. I will have to look into this to see how to best resolve.

In the meantime, if you setup ser2net following sproket-9’s example you should be able to telnet to port 10003 on your Pi and then type *VER, you should get back a version string from the Nuvo. If you can do that, you know the connection is good.

1 Like

I have updated the documentation of nuvo_simple with instructions on how to make it work over the network using ncat. While the whole integration really should be rewritten with asyncio serial, that is something that will take me lots of time with my limited knowledge. ncat works very well for me and is generally available on most Linux distros.

I changed the volume scaling (two scales, one above 50% that increments the dB much less per percent than the lower scale) which more or less mimics the keypad and “real life” volume.

I also added a keypad lock and basic speaker groups. Like sproket-9, (which in my opinion has some great ideas on how to do this) I added a Group Controller entity that can be used as a controller. You can also use any other keypad/zone as well, but a zone can only be part of any one group at a time. I ended up adding a number for the volume offset as I never could figure out how to get the MPP’s volume offset to work. It kind of did, but it was quite a mess. I liked sproket-9’s idea of essentially having the volume offset adjustable by moving the other zone’s volume once, but the problem was figuring how exactly what kind of volume change was being made. Step up and down was hit or miss using the keypads and IR remote so I just added the offset number instead. If anyone has a better way to do this I’m certainly open to changing it.

I need to update the lovelace card example to include this stuff but the basics are in the README now.

1 Like

Awesome work, Brian. I’ll give it a shot.

Hi Brian. I followed your updated github instructions, installed ncat and updated the configuration.yaml to point to the port on my Raspberry Pi and none of the media player entities show up when I try to update a dashboard. I don’t really know how to fault find here unfortunately. I reviewed all the RPi configs and it all seems align with your instructions. I set up 6 test zones and 6 test sources just to try it out. Nada. Your troubleshooting lists some code to add to the config.yaml for logs. I’ve added that but don’t know where to find the logs. Sorry. I’m a noob to HA. Still trying to find my way. Are there any simple steps I can follow to identify the root cause? Is there a way to test the comms from the RPi to the Nuvo firstly? That would be a good start.

Hi Steve,

Your troubleshooting lists some code to add to the config.yaml for logs. I’ve added that but don’t know where to find the logs.

You can click on the gear icon(Settings), go to System, then Logs. You can type in nuvo in “Search logs” box at the top to just filter out those entries. Make sure to click “Load Full Logs” if that button pops up.

. Are there any simple steps I can follow to identify the root cause? Is there a way to test the comms from the RPi to the Nuvo firstly? That would be a good start.

Sorry I didn’t mention this again, but it’s the same method as before. Just telnet to that port and type in *VER and hit enter. You should see a string come back. If on a linux system. open a terminal, type in telnet 59001 and that should connect you. If using Windows, I would use PuTTY, which is free and supports telnet. Just open a connection to your RPi on that port number.

I would bet there just isn’t a connection to the Nuvo. If that is the case, nothing will be setup as the integration checks the model so it knows what entities to create. The logs will show this error though.

If you don’t get anywhere telnetting into that port, you might want to install minicom (or another terminal program) directly on the RPi and see if you can talk to it from there. It should just require a straight through RS232 cable from the Nuvo to the USB ↔ serial adapter.

1 Like

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