HASS.io with MySensors serial gateway config.yaml issues

Tags: #<Tag:0x00007f4650f1b330>

Hi all,

I have been attempting to configure a serial gateway with Hass.io on my rpi2. I have an arduino plugged into the rpi via USB and the serial gateway code installed and a NRF22L01 connected. when editing the configuration.yaml file i have inserted:

mysensors:
gateways:
- device: '/dev/ttyUSB0’
persistence_file: '/config/mysensors.json’
baud_rate: 115200
persistence: true
version: 2.0

But when i go to check config on HA configuration tab i get errors:

2017-08-06 15:15:05 ERROR (MainThread) [homeassistant.config] Invalid config for [mysensors]: not a valid value for dictionary value @ data[‘mysensors’][‘gateways’][0][‘device’]. Got ‘/dev/ttyUSB0’. (See /config/configuration.yaml, line 65). Please check the docs at https://home-assistant.io/components/mysensors/
2017-08-06 15:15:05 ERROR (MainThread) [homeassistant.setup] Setup failed for mysensors: Invalid config.


Failed config
mysensors:
gateways: [source /config/configuration.yaml:69]
- baud_rate: 115200
device: /dev/ttyUSB0
persistence_file: /config/mysensors.json
persistence: True
version: 2.0

General Errors:
- Setup failed for mysensors: Invalid config.

Successful config (partial)
mysensors:

I have just installed everything today and cant find any info of valid/ existing directories.

I would be grateful for any help!

Thanks,
Rob2901

1 Like

Do you have access to serial ports in hass.io without a special addon?

Hi Martin,

thank you for the help.
I found the command: dmesg | grep tty
and entered through putty with the results:

core_ssh:~# dmesg | grep tty

[ 0.096089] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 6.007947] usb 1-1.5: ch341-uart converter now attached to ttyUSB0

so i can see that the arduino is attached to ttyUSB0.

i also updated my config.yaml file to include the following instead:

mysensors:
gateways:
- device: '/dev/ttyUSB0’
persistence_file: '/mysensors4.json’
baud_rate: 115200
optimistic: false
persistence: true
retain: true
version: 2.0

now the HA check is valid, so i reset my system via the restart button. i then uploaded a V2.X version of a sensor and i have it working.

Now my issue is that every time i update my system it forgets the node and i have to reset the sensor. is their a way to keep this otherwise it will get very annoying on a large scale system.

That’s what the persistence file should handle. I guess you need to make sure that home assistant can write to the path where the persistence file should be. The home assistant config directory usually works. But I have never run hass.io.

I am having a similar issue. I am running hass.io and I want to define the persistence file as .json rather then the default .pickle. I am trying to add it to the Configuration folder, but no path I have tried will work. (e.g. ‘config/mysensors.json’, ‘core/config/mysensors.json’, etc…

I have also responded to a similar post on the Mysensors forum.

Hi

I’m stuck in the same place

Connected the serial gateway which I built following these instructions : serial gateway to my RPI3.
Also configured in the configuration.yaml file :

image

and I confirmed (after reading carefully your post) USB connection by writing in the terminal :
image

Unfortunately I get this error :

image

and the log file (via configurator adds on) :

I’ll appreciate your help very much
Thanks

in addition when I type in the terminal (via terminal add on) :
hassio host hardware
I get :
image

Hi,

Did anyone find a solution to this? I’ve followed the example (HA .71 docker) with the following config

mysensors:
  gateways:
    - device: mqtt
      persistence_file: "/config/mysensors.json"
      topic_in_prefix: "mygateway1-out"
      topic_out_prefix: "mygateway1-in"
  optimistic: false
  persistence: true
  retain: true
  version: 2.0

and get the following error in the log file

  mysensors: 
    - Invalid config for [mysensors]: /config directory does not exist or is not writeable for dictionary value @ data['mysensors']['gateways'][0]['persistence_file']. Got '/config/mysensors.json'. (See /config/configuration.yaml, line 38). Please check the docs at https://home-assistant.io/components/mysensors/
    - cloud: ?

The mysensors.json file is not created, do I need to create an empty file to kick start things?

Any pointers to get me heading in the right direction would be most appreciated.

Cheers.