Can't use ttyUSB0 device on Hass.io (with Enocean USB300)

Hello,

I’ve trying to configure EnOcean Hub and binary sensor to my home assistant configuration but I’ve a problem by using the USB 300 dongle.

When I plugged in, I see it in dmesg :

[152129.856445] usb 1-1.5: new full-speed USB device number 5 using dwc_otg
[152129.986749] usb 1-1.5: New USB device found, idVendor=0403, idProduct=6001
[152129.986773] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[152129.986786] usb 1-1.5: Product: EnOcean USB 300 DB
[152129.986798] usb 1-1.5: Manufacturer: EnOcean GmbH
[152129.986810] usb 1-1.5: SerialNumber: FT1SEG3T
[152129.995454] ftdi_sio 1-1.5:1.0: FTDI USB Serial Device converter detected
[152129.995734] usb 1-1.5: Detected FT232RL
[152129.996807] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUSB0

If i check in HassIO hardware check I could see it correctly :

serial:
/dev/ttyAMA0
/dev/ttyUSB0
input:
disk:
gpio:
gpiochip0
gpiochip100
audio:
0:
name: bcm2835 - bcm2835 ALSA
type: ALSA
devices:
0: digital audio playback
1: digital audio playback

But if I check in /dev folder I can’t see /dev/ttyUSB0 or any other serial file descriptor.
I use a RPi3 with Hassio. I use it also with Phillips Hue, Xiaomi Home, and some another things without any problem. The problem seems only by using USB dongle in HassIO and the USB device mounted in host resinOS seems to be not properly mapped to home assistant distribution.

Any idea ?

1 Like

Hey there,

for me this worked out easily.
Mine is mounted to USB1 since I have two other USB devices plugged into my RPi3
I did not have to do anything else than giving HA the USB mount of the host OS (via config).

Which “folder” are you checking? The host OS one or the Home Assistant container one?

What exactly is not working?

My config:

enocean:
  device: /dev/ttyUSB1

...
binary_sensor:
  - platform: enocean
    id: [0x12,0x34,0x56,0x78] #put your switch ID here

I think I’ve checked the home assistant container because I use SSH server add on in Hass IO and I also could see config folder.

Here is my config :

enocean:
  device: /dev/ttyUSB0

binary_sensor:
  - platform: enocean
    id: [0x00,0x32,0x2F,0xC0]

But I could see no change in sensor on my HA web front.
Here is the result of ls /dev :

core-ssh:~# ls /dev/
fd       full     init     mqueue   null     ptmx     pts      random   shm      stderr   stdin    stdout   tty      urandom  zero

I think you SSH into the hass.io container, there I also do not see the USB devices and get the same result for ls /dev

I use this Automation for each button on the enocean switch:

#Switch Nr. 1
  - alias: 'Enocean Handfernbedienung Taste 1'
    initial_state: 'on'
    trigger:
      platform: event
      event_type: button_pressed
      event_data:
        id: [0x12,0x34,0x45,0x78]
        pushed: 1
        which: 1
        onoff: 0
    action:
      - service: switch.toggle
        entity_id: switch.xxx

Did you know How I can ensure the EnOcean hub is really operational ? Because in fact the problem I think is the hub which not functional because I don’t see /dev/ttyUSB0, but maybe it’s ok, and the problem are more often the wall switch I used which wasn’t compatible with HA… Did you know some debug mode or a detail for seeing EnOcean Hub log/console ?

Did you try such an automation to trigger something? My binary_sensor.enocean_binary_sensor also always shows off.

Regarding debug maybe the logger can help. I didn’t use it for enocean so no guarantee that this works:

logger:
  default: warn
  logs:
    homeassistant.components.enocean: debug

:tada: You’re right. binary sensor still stuck to off but when I put it in an automation, it works ! THANKS a LOT

Welcome, have fun with it!

hi guys
Maybe some of you can give me some advices: I’ve got an Eltako binary sensor FSM61-UC (button) which triggers an Eltako Switch FSR61-230V on/off. Now I’m new to Homeassistant and installed an USB-300 to my RPI4 and would like to do the following:

  • Visualize in Dashboard the state of the Light (is Switch on/off)?
  • Be able to trigger the switch from Dashboard Home-Assistant

My configuration.yaml file:

# Example configuration.yaml entry
enocean:
  device: /dev/serial/by-id/usb-EnOcean_GmbH_EnOcean_USB_300_DC_FT4N090Q-if00-port0

# Example configuration.yaml entry
binary_sensor:
  - platform: enocean
    id: [0xFE,0xF3,0x91,0x3B]

# Example configuration.yaml entry
switch:
  - platform: enocean
    id: [0x51,0x90,0x7E,0x2]

#Switch Nr. 1
  - alias: 'Enocean Handfernbedienung Taste 1'
    initial_state: 'on'
    trigger:
      platform: event
      event_type: button_pressed
      event_data:
        id: [0xFE,0xF3,0x91,0x3B]
        pushed: 1
        which: 1
        onoff: 0
    action:
      - service: switch.toggle
        entity_id: switch.enocean_switch

I see the Enocean Switch in my Dashboard but didn’t succeed at all. What am I missing? What should be my further steps to locolize my errors?

Every help would be highly appreciated. Thanks

Hey tbaumann,

I’m a little confused:
after #Switch Nr. 1 you’re creating an automation, however your configuration.yaml looks like this block is under switch:
Can you control the switch via the developer tools? Go to “services” and call the switch.toogle service with the corresponding entity_id. You might want to add a name: schaltername to your switch / binary sensor, so they are easy to identify.
If calling switch.toggle doesn’t work, try to add channel: 0 to your switch: block, you might have to play around with that number. Also, you have to restart HA Core after each change in your config.
The Automation you’ve created should be in automations.yaml or you can create one via the GUI like this (of course, change the Action part to one that fits your use-case):

Hi Fedot
Thanks for your response. Sorry my post was not clear enough. I already separated the configuration.yaml and automations.yaml files. (According to some other posts I tried last night to configure the Enocean switch as a light. But it still doesn’t work).
This is my current configuration.yaml file:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

# Example configuration.yaml entry
logger:
  default: info
  logs:
    homeassistant.components.enocean: debug


# Example configuration.yaml entry
enocean:
  device: /dev/serial/by-id/usb-EnOcean_GmbH_EnOcean_USB_300_DC_FT4N090Q-if00-port0

  
# Example configuration.yaml entry
binary_sensor:
  - platform: enocean
    id: [0xFE,0xF3,0x91,0x3B]


# Example configuration.yaml entry
light:
  - platform: enocean
    id: [0x51,0x90,0x7E,0x2]
    sender_id: [0xFE,0xF3,0x91,0x3B]
    

And this is my current automations.yaml file:

#Switch Nr. 1
  - alias: 'Enocean Handfernbedienung Taste 1'
    initial_state: 'on'
    trigger:
      platform: event
      event_type: button_pressed
      event_data:
        id: [0xFE,0xF3,0x91,0x3B]
        pushed: 1
        which: 1
        onoff: 0
    action:
      - service: light.toggle
        entity_id: light.enocean_light
        

When I go to developer-tools, services and run the “light.toggle”: I’m able to control the switch/light (button moves in dashboard). So I think the automation should be correct. Somehow I’m not able to trigger the automation by pressing the binary-sensor (Wall Switch). But in the homeassistant log I see the entries of the USB-Controller.

2020-06-15 13:43:07 DEBUG (Thread-2) [homeassistant.components.enocean] Received radio packet: FE:F3:91:3B->FF:FF:FF:FF (-65 dBm): 0x01 [‘0xf6’, ‘0x70’, ‘0xfe’, ‘0xf3’, ‘0x91’, ‘0x3b’, ‘0x30’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x41’, ‘0x0’] OrderedDict()
2020-06-15 13:43:07 DEBUG (Thread-2) [homeassistant.components.enocean] Received radio packet: FE:F3:91:3B->FF:FF:FF:FF (-53 dBm): 0x01 [‘0xf6’, ‘0x0’, ‘0xfe’, ‘0xf3’, ‘0x91’, ‘0x3b’, ‘0x20’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x35’, ‘0x0’] OrderedDict()

Any idea how I should proceed? Thank you very much!

Hm, let’s see if the Device ID is correct :slight_smile:
Go to developer tools -> events
At the bottom, enter button_pressed as the event to listen to and start listening.
Now press all buttons on your remote. I guess it has 4 buttons? After pressing (and releasing) each one you should have 8 events in the log that gets appended to the page.
If this works: Maybe the IDs must be decimal when entered manually. If you paste that into the automation GUI, they get converted. In your case, try creating an automation similar to the screenshot I posted.
If you really want to use yaml manually, try this:

#Switch Nr. 1
  - alias: 'Enocean Handfernbedienung Taste 1'
    initial_state: 'on'
    trigger:
      platform: event
      event_type: button_pressed
      event_data:
        id:
          - 254
          - 243
          - 145
          - 59
        pushed: 1
        which: 1
        onoff: 0
    action:
      - service: light.toggle
        entity_id: light.enocean_light

Hi fedot
Listening to “button_pressed” works. I’ve got the following outcome (I only have one button so there are two entries):

Event 1 fired 10:04 PM:
{
“event_type”: “button_pressed”,
“data”: {
“id”: [
254,
243,
145,
59
],
“pushed”: 0,
“which”: 0,
“onoff”: 0
},
“origin”: “LOCAL”,
“time_fired”: “2020-06-15T20:04:39.032147+00:00”,
“context”: {
“id”: “cb96fc09236741e1b75f29c540523d18”,
“parent_id”: null,
“user_id”: null
}
}
Event 0 fired 10:04 PM:
{
“event_type”: “button_pressed”,
“data”: {
“id”: [
254,
243,
145,
59
],
“pushed”: 1,
“which”: 0,
“onoff”: 0
},
“origin”: “LOCAL”,
“time_fired”: “2020-06-15T20:04:38.808512+00:00”,
“context”: {
“id”: “02cf10e4c63344478aad211819f899b3”,
“parent_id”: null,
“user_id”: null
}
}

I also tried to past your automation. But no progress so far. What do you mean by “if you paste that into the automation GUI, they get converted.” What do you mean by “that”? The ID of the binary sensor?

Hey tbaumann,

yes, the ID gets converted to decimal, looks identical to the event log you’ve posted.
Did you try the yaml I provided? The IDs match your remote. Save it, restart HA and press a button on your remote.
Now look under “Configuration” -> “Automations”: Does the “last triggered” under your automation show the time at which you’ve pressed the button?

hi Fedot
I got it working! According to the Event-Listener I had to edit your automation.yaml file just a little bit:
I turned “which”: from 1 to 0. Now it works. By hitting the wall switch the light-button moves :raised_hands:. Thank you very much vor your time and help.

Next I try to turn the light on/off via Home-Assistant Dashboard. With “Dolphinview Advanced” software I sent some teach-in telegrams to the Eltakto actor with an specific sender_id. The teach-in worked fine. So I moved the USB300 back to Raspberry PI and restarted HA host. But somehow the light doesn’t turn on/off. I see the small LED-flashing on the USB when I hit the light.enocean-button in HA. Think I buy a 2nd USB300 to be able to see what exactly HA is sending via the USB300… :rofl:

This is my configuration.yaml file:

# Example configuration.yaml entry
light:
  - platform: enocean
    id: [0x05,0x19,0x07,0xE2]
    sender_id: [0xFF,0xF2,0x13,0x64]

I’m able to turn on/off the Eltako actor directly from DauphinView, using the sender_id [0xFF,0xF2,0x13,0x64] and destination_id [0x05,0x19,0x07,0xE2] from above.

Any ideas why it won’t work?

Hello tbaumann,

the light: integration is for dimmers only if I’m not mistaken. Try:

switch nodon01_0:
  - platform: enocean
    id: [0x05,0x19,0x07,0xE2]
    name: eltako_switch1
    # default channel is 0, try increasing the number if it doesn't work:
    channel: 0

Hi

I have also such questions

I Poster this in a other discussion.