RTL 433 (Custom) Component - Dead Frontend

Hi all,

I just started to write my very first component. It is based on / ripped off the MQTT component and should do the following:

  • Run rtl_433 (https://github.com/merbanan/rtl_433) in the background (subprocess), emitting JSON for every sensor read which was previously subscribed for (by channel / model / id) - channel / model / id are equivalent to “state_topic” used by the MQTT component
  • Provide a sensor platform which registers at the component with channel / model / id and reading the JSON emitted with a value_template (like the MQTT sensor)

The good news: The component and the sensor do work. They are not really finished, but they work as prove of concept. I can see the component starting, the subprocess is started and the sensor is updated (all seen in the hass-log).

The bad news: activating the component in configuration.yaml (see code below) kills the frontend. It is not working any more, I get connection errors trying to connect via web browser and the weirdest part: There is not a singe error or warning in the log which would explain why the frontend fails to start.

What could be going wrong?

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: xxx
  longitude: xxx
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: xxx
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Berlin

  customize: !include /home/pi/repositories/homeassistant/customize.yaml

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  api_password: xxx

# Checks for available updates
updater:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

logger:
  default: info
  logs:
    homeassistant.components.device_tracker.fritz: warn
    homeassistant.components.camera: warn
    homeassistant.components.http: warn
    custom_components.rtl433: debug

recorder:
  db_url: postgres://@/homeassistant

# Text to speech
tts:
  platform: google

# The MQTT broker to use
mqtt:
  broker: xxx
  port: 1883
  client_id: home-assistant
  username: xxx
  password: xxx

# This is the section that kills the frontend -> enabling my custom component
rtl433:
  hop_interval: 60
  rtl_path: '/usr/local/bin/rtl_433'
  protocols:
    - 25
    - 03

media_player:
  - platform: yamaha
    name: RX-V473
    host: xxx
    source_names:
      HDMI1: "TV"
      HDMI2: "XBox"
      HDMI3: "WII U"
    source_ignore:
      - "AV1"
      - "AV2"
      - "AV3"
      - "AV4"
      - "AV5"
      - "AV6"
      - "HDMI4"
      - "TUNER"

telegram_bot:
  - platform: broadcast
    api_key: xxx
    allowed_chat_ids:
      - xxx

automation: !include_dir_merge_list /home/pi/repositories/homeassistant/automation/

group: !include /home/pi/repositories/homeassistant/groups.yaml

zone: !include /home/pi/repositories/homeassistant/zones.yaml

device_tracker: !include /home/pi/repositories/homeassistant/device_tracker.yaml

sensor: !include_dir_merge_list /home/pi/repositories/homeassistant/sensor

binary_sensor: !include_dir_merge_list /home/pi/repositories/homeassistant/binary_sensor

switch: !include_dir_merge_list /home/pi/repositories/homeassistant/switch

notify: !include_dir_merge_list /home/pi/repositories/homeassistant/notify

alert: !include_dir_merge_named /home/pi/repositories/homeassistant/alert

So, I can’t say why it doesn’t work, but I would suggest you try a shell script like this:

/usr/local/bin/rtl_433 -f 345000000 -F json -R 70 -U | while read line
do
  echo $line | /usr/bin/mosquitto_pub -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASS -i RTL_433 -r -l -t 
done

That will forward anything it finds to the MQTT server you specify, and then you can pull it like any other MQTT thing (sensor, binary_sensor, etc).

I had this working already but absolutely wanted to build a component :-/