RFXTRX sensors stop reporting after a few days

well, I think I should move this to my own thread :slight_smile:

I have an same issue with 0.111 HA core in venv and RFXTRX433XL on a seperate pi with ser2net.

sensors work fine for a few days and suddenly stop reporting. restart of HA does not fix it for me, resetting the sensor (so it gets a new ID that pops up in HA) fixes it, they are re-discovered with a new ID and I can use that ID to add them to my configuration.yaml.
after a few days, all my sensor stop working again, and I have to reset all of them. the RFXTRX component seems to receive the packages, as seen in the log, just they dont update the devices I added.

I still see things like this in my log (enabled debug for rfxtrx), but the sensors are “unknown” for a while now:

2020-06-24 09:36:00 DEBUG (Thread-3) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 73c300_78 Class: RFXtrxDevice Sub: 1, Pkt_id: 0a4e010173c30047008529)
2020-06-24 09:36:12 DEBUG (Thread-3) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 73c300_78 Class: RFXtrxDevice Sub: 1, Pkt_id: 0a4e010273c30047008529)
2020-06-24 09:36:32 DEBUG (Thread-3) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 73c300_78 Class: RFXtrxDevice Sub: 1, Pkt_id: 0a4e010373c30048008529)
2020-06-24 09:36:36 DEBUG (Thread-3) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 73c300_78 Class: RFXtrxDevice Sub: 1, Pkt_id: 0a4e010473c30048008529)
2020-06-24 09:36:48 DEBUG (Thread-3) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 73c300_78 Class: RFXtrxDevice Sub: 1, Pkt_id: 0a4e010573c30048008529)
2020-06-24 09:37:00 DEBUG (Thread-3) [homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 73c300_78 Class: RFXtrxDevice Sub: 1, Pkt_id: 0a4e010673c30048008529)

any way to extract the device identifier from the log records?

my configuration.yaml looks like this:

sensor:
  - platform: rfxtrx
    #automatic_add: true
    devices:
      0a4e0100e4b9001a001939:
        name: MaverickBBQ
        data_type:
         - Temperature
         - Battery numeric
      105602b79e000000000300106874205249:
        name: Windmesser
        data_type:
         - Wind direction
         - Wind average speed
         - Wind gust
         - Chill
         - Battery numeric
      0a520200da0100de3e0139:
        name: Temperaturmesser
        data_type:
         - Temperature
         - Humidity
         - Humidity status
         - Battery numeric

Bildschirmfoto 2020-06-24 um 10.38.48

when I remove all devices from yaml again and restart HA, they are automatically added again:

2020-06-24 09:54:48 INFO (Thread-3) [homeassistant.components.rfxtrx.sensor] Automatic add rfxtrx.sensor: 0a4e010173c3004b008429

So I kinda solved this myself by not using the rfxtrx component, but using mqtt instead.
What I did was to install node-red on the remote pi and added rfx support: https://flows.nodered.org/node/node-red-contrib-rfxcom

this publishes to MQTT topics and home assistant listens to these. works flawlessly so far.

Node Red flow:

[
    {
        "id": "8609ede5.1a7f2",
        "type": "tab",
        "label": "rfx2mqtt",
        "disabled": false,
        "info": ""
    },
    {
        "id": "3dd0a9c4.71b846",
        "type": "rfx-sensor",
        "z": "8609ede5.1a7f2",
        "name": "",
        "port": "691ef83b.b3e5e8",
        "topicSource": "all",
        "topic": "",
        "x": 200,
        "y": 380,
        "wires": [
            [
                "dc2c0e50.8e90e8",
                "39e1713d.8eaf4e",
                "b2ad6e0c.47e4"
            ]
        ]
    },
    {
        "id": "39e1713d.8eaf4e",
        "type": "debug",
        "z": "8609ede5.1a7f2",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "x": 440,
        "y": 620,
        "wires": []
    },
    {
        "id": "7d52940f.9880ac",
        "type": "mqtt out",
        "z": "8609ede5.1a7f2",
        "name": "",
        "topic": "bbq",
        "qos": "",
        "retain": "",
        "broker": "4f25098f.8888d",
        "x": 590,
        "y": 220,
        "wires": []
    },
    {
        "id": "dc2c0e50.8e90e8",
        "type": "switch",
        "z": "8609ede5.1a7f2",
        "name": "",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "MAVERICK",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "TH2",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "WIND",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "RAIN2",
                "vt": "str"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 5,
        "x": 410,
        "y": 280,
        "wires": [
            [
                "7d52940f.9880ac"
            ],
            [
                "73f73a01.f87264"
            ],
            [
                "22634f0a.aeb9a8"
            ],
            [
                "eef1261d.029c1"
            ],
            [
                "d85c2055.006278"
            ]
        ]
    },
    {
        "id": "73f73a01.f87264",
        "type": "mqtt out",
        "z": "8609ede5.1a7f2",
        "name": "",
        "topic": "wetterstation/temperatur",
        "qos": "",
        "retain": "",
        "broker": "4f25098f.8888d",
        "x": 650,
        "y": 280,
        "wires": []
    },
    {
        "id": "22634f0a.aeb9a8",
        "type": "mqtt out",
        "z": "8609ede5.1a7f2",
        "name": "",
        "topic": "wetterstation/wind",
        "qos": "1",
        "retain": "",
        "broker": "4f25098f.8888d",
        "x": 630,
        "y": 340,
        "wires": []
    },
    {
        "id": "b2ad6e0c.47e4",
        "type": "debug",
        "z": "8609ede5.1a7f2",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "topic",
        "targetType": "msg",
        "x": 430,
        "y": 680,
        "wires": []
    },
    {
        "id": "d85c2055.006278",
        "type": "mqtt out",
        "z": "8609ede5.1a7f2",
        "name": "",
        "topic": "andere_rfx",
        "qos": "",
        "retain": "",
        "broker": "4f25098f.8888d",
        "x": 610,
        "y": 460,
        "wires": []
    },
    {
        "id": "eef1261d.029c1",
        "type": "mqtt out",
        "z": "8609ede5.1a7f2",
        "name": "",
        "topic": "wetterstation/regen",
        "qos": "",
        "retain": "",
        "broker": "4f25098f.8888d",
        "x": 630,
        "y": 400,
        "wires": []
    },
    {
        "id": "691ef83b.b3e5e8",
        "type": "rfxtrx-port",
        "z": "",
        "port": "/dev/ttyUSB0",
        "enableDebug": true,
        "rfyVenetianMode": "EU"
    },
    {
        "id": "4f25098f.8888d",
        "type": "mqtt-broker",
        "z": "",
        "name": "zentral",
        "broker": "192.168.132.3",
        "port": "1883",
        "clientid": "rfxPi",
        "usetls": false,
        "compatmode": false,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": ""
    }
]

and the home assistant sensor config to go with it:

sensor:
  - platform: mqtt
    state_topic: "wetterstation/regen"
    name: NiederschlagAktuell
    unit_of_measurement: mm/hr
    value_template: "{{ value_json.rainfall.rate.value }}"
  - platform: mqtt
    state_topic: "wetterstation/regen"
    name: NiederschlagGesamt
    unit_of_measurement: mm
    value_template: "{{ value_json.rainfall.total.value }}"
  - platform: mqtt
    state_topic: "wetterstation/wind"
    name: windgeschwindigkeit
    unit_of_measurement: m/s
    value_template: "{{ value_json.wind.speed.value }}"
  - platform: mqtt
    state_topic: "wetterstation/wind"
    name: windböhe
    unit_of_measurement: m/s
    value_template: "{{ value_json.wind.gust.value }}"
  - platform: mqtt
    state_topic: "wetterstation/wind"
    name: richtung
    unit_of_measurement: degrees
    value_template: "{{ value_json.wind.direction.value }}"
  - platform: mqtt
    state_topic: "wetterstation/temperatur"
    name: außentemperatur
    unit_of_measurement: degrees
    device_class: temperature
    value_template: "{{ value_json.temperature.value }}"
  - platform: mqtt
    state_topic: "wetterstation/temperatur"
    name: luftfeuchtigkeit_außen
    unit_of_measurement: '%'
    device_class: humidity
    value_template: "{{ value_json.humidity.value }}"
  - platform: mqtt
    state_topic: "bbq"
    name: maverick_temp1
    unit_of_measurement: degrees
    device_class: temperature
    value_template: "{{ value_json.temperature.value[0] }}"
  - platform: mqtt
    state_topic: "bbq"
    name: maverick_temp2
    unit_of_measurement: degrees
    device_class: temperature
    value_template: "{{ value_json.temperature.value[1] }}"

this is a setup for an Oregon Scientific WMR86 based weather station and a Maverick BT-733 bbq thermometer.

hope this helps somebody