Mysensors notify not working (Resolved)

I’m trying to send text to an LCD display. I’ve started with the example from here https://home-assistant.io/components/notify.mysensors/ which runs fine but just loops around
Requesting initial value from controller
50677 TSF:MSG:SEND,1-1-0-0,s=1,c=2,t=47,pt=0,l=0,sg=0,ft=0,st=OK:
Sending initial value
52685 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=47,pt=0,l=1,sg=0,ft=0,st=OK:-
Requesting initial value from controller
52697 TSF:MSG:SEND,1-1-0-0,s=1,c=2,t=47,pt=0,l=0,sg=0,ft=0,st=OK:

Whilst in the HA logs I see this:
ERROR (Thread-2) [mysensors] Not a valid message: Not valid message sub-type: 47 for dictionary value @ data[‘sub_type’]

Clearly something is out of whack if the examples don’t work!

How did you even get it to start? The example configuration doesn’t even work for me. Gives a permissions error on the /config/ folder that every other component can write to, and even set 777 it passes the same error. Heck, homeassistant itself gives

ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /config/home-assistant.log (access denied)

and that is on a fresh install. Hass.io just doesn’t want to play nice like hassbian does. No matter the config I get:

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

Sorry, not to thread jack, just wondering how you got mysensors to even get past component loading.

No problem, I fixed my issue by changing the version from 2.0 to 2.1 because I’m using the 2.1 library.

With regard to your problem, I didn’t do anything special to get this to work, I’m using HASSIO. Could you post your msysensors config section?

I just changed 2.0 to 2.1 and was going to laugh if it was that simple, but it didn’t help me. Here is my config, If you could share what is working for you that would be great as well. I’ve tried all number of things to get it to work and always verified the YAML was valid, but no go.

mysensors:
  gateways:
    - device: '/dev/ttyACM0'
      persistence_file: '/config/mysensorsacm0.json'
      baud_rate: 115200
    - device: '/dev/ttyACM1'
      persistence_file: '/config/mysensorsacm1.json'
      baud_rate: 115200
    - device: mqtt
      persistence_file: '/config/mysensorsMQTT.json'
      topic_in_prefix: 'mysensors-out'
      topic_out_prefix: 'mysensors-in'
  optimistic: false
  persistence: true
  retain: true
  version: '2.1'

Pretty much the same as the example unless I’m really glossing something over.

Here is startup log:

core-ssh:/config# hassio homeassistant check
Error on homeassistant/check: starting version 3.2.4
Testing configuration at /config
2017-12-18 20:40:36 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /config/home-assistant.log (access denied)
2017-12-18 20:40:38 INFO (MainThread) [homeassistant.setup] Setting up introduction
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up mqtt
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain introduction took 1.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up http
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up recorder
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up api
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up system_log
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up history
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up frontend
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up discovery
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up group
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up sun
2017-12-18 20:40:39 ERROR (MainThread) [homeassistant.config] Invalid config for [mysensors]: /config directory does not exist or is not writetable for dictionary value @ data['mysensors']['gateways'][0]['persistence_file']. Got '/config/mysensorsacm0.json'
not a valid value for dictionary value @ data['mysensors']['gateways'][0]['device']. Got '/dev/ttyACM0'. (See /config/configuration.yaml, line 55). Please check the docs at https://home-assistant.io/components/mysensors/
2017-12-18 20:40:39 ERROR (MainThread) [homeassistant.setup] Setup failed for mysensors: Invalid config.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up sensor
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up zwave
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up zha
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up updater
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.2 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.2 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.2 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up zone
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.1 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain zwave took 0.1 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain zha took 0.1 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.1 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up conversation
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up config
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up tts
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up logbook
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up script
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up automation
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setting up device_tracker
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds.
2017-12-18 20:40:39 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 0.0 seconds.
Failed config
  mysensors:
    gateways: [source /config/configuration.yaml:56]
      - baud_rate: 115200
        device: /dev/ttyACM0
        persistence_file: /config/mysensorsacm0.json
      - baud_rate: 115200
        device: /dev/ttyACM1
        persistence_file: /config/mysensorsacm1.json
      - device: mqtt
        persistence_file: /config/mysensorsMQTT.json
        topic_in_prefix: mysensors-out
        topic_out_prefix: mysensors-in
    optimistic: False
    persistence: True
    retain: True
    version: 2.1
  General Errors:
    - Setup failed for mysensors: Invalid config.
Successful config (partial)
  mysensors:

dmesg for each gateway

[2335071.285980] usb 1-1.5: new full-speed USB device number 11 using dwc_otg
[2335071.398326] usb 1-1.5: New USB device found, idVendor=1209, idProduct=6949
[2335071.398350] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2335071.398363] usb 1-1.5: Product: Sensebender GW
[2335071.398375] usb 1-1.5: Manufacturer: MySensors.org
[2335071.403612] cdc_acm 1-1.5:1.0: ttyACM1: USB ACM device
[2335115.346594] usb 1-1.2: USB disconnect, device number 9
[2335119.426266] usb 1-1.2: new full-speed USB device number 12 using dwc_otg
[2335119.538491] usb 1-1.2: New USB device found, idVendor=1209, idProduct=6949
[2335119.538513] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2335119.538526] usb 1-1.2: Product: Sensebender GW
[2335119.538538] usb 1-1.2: Manufacturer: MySensors.org
[2335119.543406] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device

I’m at the point where I’m just going to do a fresh install soon. Building a new controller with SSD to avoid dying SD Cards + MySensors (NRF24L01+ and RFM69. Eventually nRF52* as well)

My config looks like this.

mysensors:
  gateways:
    - device: '/dev/ttyUSB0'
      persistence_file: '/config/mysensors3.json'
      
  optimistic: false
  persistence: false
  version: '2.1'

The file permissions are like this

-rw-r--r--    1 root     root           369 Dec 17 20:22 mysensors3.json

Do you really have three different gateways? Does it work if you use just one?

The reason I changed the version to 2.1 was because I was having an issue with V_TEXT, my system works with 2.0 just as well apart from V_TEXT fails.

The only problem I’m left with is that some of the sensors don’t reappear after I reboot HA. It might be because I turned off persistence.

I have 3 because I use one gateway with the NRF24L01+ for nodes with that radio (and nRF51/52 that have radio+processor in one chip), one with the RFM69HW for nodes using that radio, and MQTT for nodes usually via WiFi.

Yeah, with persistence set to false the sensors don’t persist through reboots.

I tried leaving just one gateway and still get the permissions errors. Something is messed up somewhere and I just can’t figure out what. Worked just dandy on hassbian. Someone else showed the same error and said it was a syntax problem for them, but the only syntax failure I get is what I posted above. Weird that “ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /config/home-assistant.log (access denied)” shows up as the first thing. I don’t really have much installed or customized at this point and am moving to using an SSD for storage/boot so maybe I’ll just cross my fingers that fixes whatever the heck is causing this headache.

I converted both our configs to JSON and I can’t see a difference besides having multiiple controllers (just 1 didn’t work either)

{
    "mysensors": {
        "gateways": [
            {
                "device": "/dev/ttyACM0",
                "persistence_file": "/config/mysensorsacm0.json",
                "baud_rate": 115200
            },
            {
                "device": "/dev/ttyACM1",
                "persistence_file": "/config/mysensorsacm1.json",
                "baud_rate": 115200
            },
            {
                "device": "mqtt",
                "persistence_file": "/config/mysensorsMQTT.json",
                "topic_in_prefix": "mysensors-out",
                "topic_out_prefix": "mysensors-in"
            }
        ],
        "optimistic": false,
        "persistence": true,
        "retain": true,
        "version": "2.1"
    }
}

{
    "mysensors": {
        "gateways": [
            {
                "device": "/dev/ttyUSB0",
                "persistence_file": "/config/mysensors3.json"
            }
        ],
        "optimistic": false,
        "persistence": false,
        "version": "2.1"
    }
}

So the problem is somewhere else. Fresh install here I come, hopefully this doesn’t become a regular thing with hass.io, weird some components can access read/write to /config/ just fine, but HASS itself complains about not being able to write to the directory when other components like zwave, zigbee, etc… all can write fine.

Resolved, didn’t like device_tracker placed in an external file. Why the errors had nothing to do with that but instead complained about MySensors and permissions errors is a little odd, especially syntax was coming up as valid in HAs web interface, but not via the console add-on. So many hours wasted over such a silly thing. Now I can add the RFM96 LoRa gateway,

Time to find if there is a way at all to enable the console via HDMI just to display some stats on a small display that was planned to be built into the HA controllers case. Might have to resort to a Nextion display and communicate via UART if it goes anything like this as most threads just end with saying it is headless, but I just want some simple stats.

I never trust the web configuration check, it misses stuff all the time.

I’ve been looking at the display options myself and I think the easiest way is to build a mysensors display and send the data to it as V_TEXT. There’s some nice multiline displays that run on I2C plus you can add some physical buttons to cycle through the info or do other useful stuff.
https://forum.mysensors.org/topic/1957/lcd-clock-and-text-sensor-node-with-new-v_text