Homeassitant doesn't get values from mysensors sensor node

Hello. Cannot get sensor data values in homeassistant. Tried everything cannot make it working.
I am running dockerized homeassistant, mosquito mqqt broker and mqqt gateway on the same RPI.

Temperature and humidity are being published correctly:

Homeassistant is connect to mqqt as i Can control and get values of my sonoof basic switch with no problems.

File permissions:

pi@raspberrypi:/opt/homeassistant $ ls -l
total 2044
-rw-r–r-- 1 root root 2 Jan 2 21:27 automations.yaml
-rw-r–r-- 1 root root 3062 Jan 27 09:43 configuration.yaml
-rw-r–r-- 1 root root 1794 Jan 2 21:47 configuration.yaml.save
-rw-r–r-- 1 root root 2090 Jan 20 14:47 configuration.yaml.save.1
-rw-r–r-- 1 root root 2430 Jan 20 14:47 configuration.yaml.save.2
-rw-r–r-- 1 root root 0 Jan 2 21:27 customize.yaml
drwxr-xr-x 2 root root 4096 Jan 2 21:27 deps
-rw-r–r-- 1 root root 0 Jan 2 21:27 groups.yaml
-rw-r–r-- 1 root root 7987 Jan 27 09:52 home-assistant.log
-rw-r–r-- 1 root root 2043904 Jan 27 09:44 home-assistant_v2.db
-rw-r–r-- 1 root root 359 Jan 27 09:34 mysensors1.pickle
-rw-r–r-- 1 root pi 0 Jan 27 08:59 mysensors4.json
-rw-r–r-- 1 root root 0 Jan 2 21:27 scripts.yaml
-rw-r–r-- 1 root root 157 Jan 2 21:27 secrets.yaml
drwxr-xr-x 2 root root 4096 Jan 2 21:27 tts

Homeassistant log:

2019-01-27 09:43:29 WARNING (SyncWorker_1) [mysensors.persistence] File does not exist or is not readable: /opt/homeassistant/mysensors1.pickle
2019-01-27 09:43:29 WARNING (SyncWorker_1) [mysensors.persistence] Trying backup file: /opt/homeassistant/mysensors1.pickle.bak
2019-01-27 09:43:29 WARNING (SyncWorker_1) [mysensors.persistence] File does not exist or is not readable: /opt/homeassistant/mysensors1.pickle.bak
2019-01-27 09:43:29 WARNING (SyncWorker_1) [mysensors.persistence] Failed to load sensors from file: /opt/homeassistant/mysensors1.pickle
2019-01-27 09:43:29 ERROR (SyncWorker_4) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:43:29 INFO (MainThread) [mysensors.gateway_mqtt] Setting up initial MQTT topic subscription
2019-01-27 09:43:29 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: mygateway1-out/+/+/0/+/+, qos: 0
2019-01-27 09:43:29 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: mygateway1-out/+/+/3/+/+, qos: 0
2019-01-27 09:43:39 ERROR (SyncWorker_5) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:43:49 ERROR (SyncWorker_11) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:43:59 ERROR (SyncWorker_6) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:44:09 ERROR (SyncWorker_13) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:44:19 ERROR (SyncWorker_1) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:44:29 ERROR (SyncWorker_3) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:44:39 ERROR (SyncWorker_15) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle
2019-01-27 09:44:49 ERROR (SyncWorker_8) [mysensors.persistence] Permission denied when writing to /opt/homeassistant/mysensors1.pickle

Configuration.yaml

mqtt:
  broker: 192.168.1.225
  port: 1883
  client_id: home-assistant-1
#  discovery: true

logger:
  default: error
  logs:
      mysensors: debug
      homeassistant.components.mysensors: debug

mysensors:
  gateways:
    - device: mqtt
      persistence_file: '/opt/homeassistant/mysensors1.pickle'
      topic_in_prefix: 'mygateway1-out'
      topic_out_prefix: 'mygateway1-in'
  optimistic: false
  persistence: true
  retain: true
  version: '2.1'

sensor:
  - platform: mqtt
    name: "Temperature"
    state_topic: "mygateway1-out/1/0/1/0/0"
    unit_of_measurement: '°C'
    value_template: "{{ value_json.temperature }}"
  - platform: mqtt
    name: "Humidity"
    state_topic: "mygateway1-out/1/1/1/0/1"
    unit_of_measurement: '%'
    value_template: "{{ value_json.humidity }}"

Any ideas where the problem could be?

From the MQTT screenshot, I don’t think you need to define ‘value_template’ for the sensors. When defining it how you did, HA is expecting the data to be structured as a json dict with key, temperature but the data isn’t.

Beyond that, assuming your mysensors arduino sketch has a presentation() function, there should be no additional sensor config required so you could remove all the sensor with mqtt platform for this. Chances are you may need to force your sensor to present by pulling power and plugging back in and the rest or the sensor import into HA should be handled by the component.