Hi Forum!
Been running Home Assistant for almost a year now and have a pretty basic setup of network and weather details. My main usage for Home Assistant was to monitor my front porch light and my garage door. I have an MQTT sensor for my front light, and another for my door. In addition I have an MQTT switch with I use to trigger a momentary switch to cause my garage door to open/stop/close depending on what it’s doing. (Door opening/closing is controlled separately to detecting open/closed state)
Recently I decided to investigate adding an ESP8266 MQTT RGB LED strip to Home Assistant to see if I could look at some funky lighting. This website is pretty much bang on what I did with the hardware: https://eryk.io/2015/10/esp8266-based-wifi-rgb-controller-h801/ but with the code base being built pretty closely to https://github.com/mertenats/open-home-automation/tree/master/ha_mqtt_rgb_light
What I found with Home Assistant 0.41 is that after I’d used the RGB LEDs my Raspberry Pi would lock up and require the power to be pulled to restart it. I attributed this to maybe my Raspberry Pi just being slow and adding the RGBs was the straw that broke the camel’s back.
Since upgrading to 0.42 that error has gone away and I’m now facing a new issue. I can either use the MQTT switch to control my garage door, or I can use it to control the RGB LEDs, but I cannot have both systems working at the same time. Depending on which device I try and use first, after restarting Home Assistant, that will determine which device will function.
I’m using the build in MQTT broker for Home Assistant and my topics are:
-
platform: mqtt
name: ‘Bedroom RGB light’
state_topic: ‘bedroom/rgb1/light/status’
command_topic: ‘bedroom/rgb1/light/switch’
brightness_state_topic: ‘bedroom/rgb1/brightness/status’
brightness_command_topic: ‘bedroom/rgb1/brightness/set’
rgb_state_topic: ‘bedroom/rgb1/rgb/status’
rgb_command_topic: ‘bedroom/rgb1/rgb/set’
brightness_scale: 100
optimistic: false -
platform: mqtt
name: ‘Bedroom White light’
state_topic: ‘bedroom/w1/light/status’
command_topic: ‘bedroom/w1/light/switch’
brightness_state_topic: ‘bedroom/w1/brightness/status’
brightness_command_topic: ‘bedroom/w1/brightness/set’
brightness_scale: 100
optimistic: false -
platform: mqtt
name: “Toggle Garage”
state_topic: “switch/garage/door/status”
command_topic: “switch/garage/door/set”
payload_on: “ON”
payload_off: “OFF”
I’ve got the Toggle Garage switch in my switches.yaml file and my RGB LEDs in my lights.yaml file.
Has anyone experienced an issue like this with MQTT and Home Assistant? I have a bit of a feeling that it might be because my topics don’t start with the same top level name (switch/bedroom) but I’m not actually sure if that’s a requirement with MQTT.
I’m happy to provide my full code for analysis (both Home Assistant and my ESP8266/Arduino code).
Thanks heaps if anyone has any ideas! (FYI the LEDs look wicked when they work)
Kyle.