Trouble setting up MQTT with H801

First let me say that I’m a complete newbie when it comes to Home Assistant (installed it on my Pi today), MQTT and Linux. So excuse my ignorance.

Anyway, I successfully flashed a H801 RGBW controller with Espurna firmware. It’s connected to my wifi and accessible through web interface. I have Hass up and running too. I’ve installed Mosquitto as my mqtt broker and both the H801 and Hass connects to it. I can successfully send commands (topics…?) using mosquitto_pub to turn the RBG strip on and off using the following command:

mosquitto_pub -h 127.0.0.1 -p 1899 -u osen -P ***** -t lights/H801_1/relay/0/set -m 1

But I have no luck getting Hass to recognize the device using the following in configuration.yaml

H801:
platform: mqtt
name: “Testing H801”
state_topic: “lights/H801_1/relay/0”
command_topic: “lights/H801_1/relay/0/set”
payload_on: 1
payload_off: 0
rgb_state_topic: “lights/H801_1/color”
rgb_command_topic: “lights/H801_1/color/set”
rgb: true
optimistic: false
color_temp: true
color_temp_command_topic: “lights/H801_1/mired/set”
rgb_state_topic: “lights/H801_1/color”
rgb_command_topic: “lights/H801_1/color/set”
rgb: true
optimistic: false
color_temp: true
color_temp_command_topic: “lights/H801_1/mired/set”
brightness: true
brightness_scale: 255
brightness_command_topic: “lights/H801_1/brightness/set”
brightness_state_topic: “lights/H801_1/brightness”
white_value: true
white_value_command_topic: “lights/H801_1/channel/3/set”
white_value_state_topic: “lights/H801_1/channel/3”

All I get is the following:

2017-12-14 10:55:58 ERROR (MainThread) [homeassistant.loader] Unable to find component H801
2017-12-14 10:55:58 ERROR (MainThread) [homeassistant.setup] Setup failed for H801: Component not found.

My mqtt settings are these (which connects to the Mosquitto broker successfully from what I can tell):

mqtt:
broker: 127.0.0.1
port: 1899
username: osen
password: ********
client_id: HomeAssistant1

I feel like I’m missing something obvious but I can’t figure out what. Too tired now, but any nudge in the right direction is appreciated.

I suspect everything you have posted there (the first bit) should be indented under switch:, at the moment you have it as a separate component of itself called H801, which does not exist.

1 Like

For mqtt lights see…

It should have a similar format as below, mine is for switches but the layout should be the same
From the component docs mqtt switch…

# Example configuration.yml entry
switch:
  - platform: mqtt
    name: "Bedroom Switch"
    state_topic: "home/bedroom/switch1"
    command_topic: "home/bedroom/switch1/set"
    availability_topic: "home/bedroom/switch1/available"
    payload_on: "ON"
    payload_off: "OFF"
    optimistic: false
    qos: 0
    retain: true

for the broker definition…

################################################
## MQTT
################################################

mqtt:
  broker: !secret mqtt_broker
  port: !secret mqtt_port
  client_id: home-assistant
  username: !secret mqtt_usern
  password: !secret mqtt_pw
  keepalive: 60
  protocol: 3.1.1

Note that all indentations need to be spaces not tabs - set your own username/password broker/port

2 Likes

Wow, it really was that simple. I didn’t even reflect over the fact that the type of device wasn’t declared. switch: works, but only as well, a switch (on/off). light: is even better, now I have full control over color, brightness and white channels :smiley:

Thanks a lot.

1 Like