NAD receiver integration via serial port /dev/ttyUSB0 very unstable

Hi everyone,

I’m pretty new to Home Assistant but, I finally think I’m getting a grasp on it. :slight_smile:

I managed to integrate a lot of different devices (Hue, Honeywell Total Connect Comfort, Alarm Panel, Camera’s, Google Home, Modbus-devices, etc…) to my Home Assistant but I’m experiencing difficulties with my C368 NAD Receiver which I can control via a serial port. Should be straightforward…

NAD Integration

My Home Assistant is running on a Rpi 3 and I use a USB-to-Serial adapter (FTDI-chip) - tried two different brands btw - to connect my NAD receiver to the Rpi. In my configuration.yaml this is what I added

# NAD Amplifier
media_player:
  - platform: nad
    serial_port: /dev/ttyUSB0
    name: NAD_Receiver
    min_volume: -60
    max_volume: -20
    sources:
      1: 'Chrome'
      5: 'Vinyl'

I can see the entity NAD_Receiver in my list with entities, and can add it to a view in Lovelace as a media player. until this point everything is fine but apparently, my installation sees the device (sometimes) and I can power On/Off the receiver but every 40 seconds or so the device becomes unavailable and comes back online. Also the volume control and source control are never visible visible.

Using screen in CommandLine

sudo screen /dev/ttyUSB0 115200 cs8 ixoff  

I can send all the commands to the receiver perfectly so there is no problem with the serial connection, I should think.

for example:

Main.Version?
Main.Volume=-40

Is it possible that the default serial settings in Home Assistant are different then

  • baudrate : 115200
  • databits : 8
  • parity : none
  • flow control : off

I checked my logs as well and no errors are showing. These are some entries of my log:

2020-10-26 21:07:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.nad_receiver, old_state=None, new_state=<state media_player.nad_receiver=off; source_list=['Chrome', 'Vinyl'], friendly_name=NAD_Receiver, icon=mdi:speaker-multiple, supported_features=3468 @ 2020-10-26T21:07:24.358289+01:00>>
2020-10-26T21:07:24.219826+01:00>, <state media_player.nad_receiver=off; source_list=['Chrome', 'Vinyl'], friendly_name=NAD_Receiver, icon=mdi:speaker-multiple, supported_features=3468
2020-10-26 21:14:35 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.nad_receiver, old_state=<state media_player.nad_receiver=off; source_list=['Chrome', 'Vinyl'], friendly_name=NAD_Receiver, icon=mdi:speaker-multiple, supported_features=3468 @ 2020-10-26T21:07:24.358289+01:00>, new_state=<state media_player.nad_receiver=unavailable; source_list=['Chrome', 'Vinyl'], friendly_name=NAD_Receiver, icon=mdi:speaker-multiple, supported_features=3468
2020-10-26 21:14:35 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1876347728] Sending {"id": 2, "type": "event", "event": {"event_type": "state_changed", "data": {"entity_id": "media_player.nad_receiver", "old_state": {"entity_id": "media_player.nad_receiver", "state": "off", "attributes": {"source_list": ["Chrome", "Vinyl"], "friendly_name": "NAD_Receiver", "icon": "mdi:speaker-multiple", "supported_features": 3468}, "last_changed": "2020-10-26T20:07:24.358289+00:00", "last_updated": "2020-10-26T20:07:24.358289+00:00", "context": {"id": "dcfeccec17c611eb9c0dcba706abcb43", "parent_id": null, "user_id": null}}, "new_state": {"entity_id": "media_player.nad_receiver", "state": "unavailable", "attributes": {"source_list": ["Chrome", "Vinyl"], "friendly_name": "NAD_Receiver", "icon": "mdi:speaker-multiple", "supported_features": 3468}, "last_changed": "

What could I be doing wrong? Can I check/set my serial port settings in some way? Or what am I missing?

Thanks!