Docker MQTT Exception in async_discover when dispatching

Hey everyone,

I’m moving my setup from an old RPi3 to a Docker Container on my main server and slowly learning how to live without add-ons.
So far so good and I’m really happy with the speed and some other aspects of a Docker HA.
One thing that I’ve run into is getting my weather station data into HA. I’ve got eclipse-Mosquitto container running and a rtl_433 container feeding from my SDR and both seem to be working.
However, I’m not getting any devices showing up in my HA instance of mosquitto. When I check the logs it shows up

Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'device_class': 'humidity', 'name': 'Acurite Tower 13066 H', 'unit_of_measurement': '%', 'value_template': '{{ value|float }}', 'state_topic': 'rtl_433/Acurite-Tower/13066/A/humidity', 'unique_id': 'rtl433sensor13066H', 'availability_topic': 'rtl_433/status', 'expire_after': 'null', 'device': {'identifiers': '13066', 'name': '13066', 'model': 'Tower', 'manufacturer': 'Acurite'}, 'platform': 'mqtt'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 348, in async_discover config = discovery_schema(discovery_payload) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 232, in __call__ return self._exec((Schema(val) for val in self.validators), v) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 355, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File "/usr/local/lib/python3.10/site-packages/voluptuous/validators.py", line 351, in _exec v = func(v) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable return schema(data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: expected int for dictionary value @ data['expire_after']

the Acuite-Tower is one of the devices I want to pull into HA but can’t figure out how to move forward.
Here is my docker-compose if that would be helpful but I feel that if I’m getting this error, the messages are getting to HA so there is something I need to do in HA?

version: '3.6'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /opt/HomeAssistant:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: bridge
    ports:
      - 8123:8123
    depends_on:
      - mosquitto
      - acurite2mqtt
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    volumes:
      - /opt/mosquitto:/mosquitto
    ports:
      - 1883:1883
      - 9001:9001  
  acurite2mqtt:
    container_name: acurite
    image: colemamd/acurite2mqtt
    devices:
      - /dev/bus/usb/
    volumes:
      - /opt/acurite2mqtt/:/data/
    restart: unless-stopped

Error looks like it’s pointing at MQTT data sent by accurite and saying it don’t like that it sent “null” text instead of “” or “0” (a blank space 0)

Thats what message error message means to me but I not use these device/integration

I WOULD

Verify no breaking change for that integration. You moved install but did you move from same version to same version OR same to different. If same all should just work but if different things will break

Look closely at the integration and verify it is properly setup. It looks like messages are received by HA but maybe just bad format. This may be configurable or other change to accommodate may be available

so it took a little bit of debugging but what I ended up doing is changing the options.json for the acurite2mqtt container to include mqtt_retain to true and to add expire_after: 0

{
    "mqtt_host": "10.0.1.129",
    "mqtt_port": "1883",
    "mqtt_user": "username",
    "mqtt_password": "password",
    "mqtt_retain": "true",
    "mqtt_topic": "rtl_433",
    "protocol": "-R 11 -R 40 -R 41 -R 55 -R 74",
    "units": "customary",
    "discovery_prefix": "homeassistant",
    "discovery_interval": 600,
    "whitelist_enable": "false",
    "whitelist": "",
    "debug": "false",
    "expire_after": 0
}

I now am able to get my weather station updates and the 3 temp/humidity sensors I have in our bedrooms into HA.