logo elektroda
logo elektroda
X
logo elektroda

MQTT Discovery Issues with Openbeaken-Flashed 2 Gang Relay on Hass Config Page

soubhikkhan 774 9
ADVERTISEMENT
  • #1 20712561
    soubhikkhan
    Level 3  

    I have flashed the device with openbeacon. The device is working and I'm able to listen and set the MQTT topics from Hass MQTT config page. The relays are responding well! But the device is not getting discovered. What am I missing? Configuration interface for Wall Switch 2 gang with MQTT settings. MQTT configuration form for a wall switch with two sections. User interface for Wall Switch 2 gang with toggle options.
  • ADVERTISEMENT
  • #2 20712614
    p.kaczmarek2
    Moderator Smart Home
    Hello, do you click "Start home assistant discovery"?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20713373
    soubhikkhan
    Level 3  
    Yes, I did! It shows, MQTT discovery queued.
  • #5 20713383
    soubhikkhan
    Level 3  

    Ah, thanks for pointing that out! I don't know why it's taking space between characters!

    Received message on illegal discovery topic 'homeassistant/switch/Wall Switch 2 gang_relay_0/config'. The topic contains not allowed characters. For more information, see https://www.home-assistant.io/integrations/mqtt/#discovery-topic
    9:19:31 AM – (WARNING) MQTT - message first occurred at August 28, 2023, at 5:16:52 PM and shows up 6 times

    Added after 1 [minutes]:

    Even in the obk, it shows like this!
    mqtt:
    switch:
    - unique_id: "Wall Switch 2 gang_relay_0"
    name: 0
    state_topic: "obk_wall_switch/0/get"
    command_topic: "obk_wall_switch/0/set"
    qos: 1
    payload_on: 1
    payload_off: 0
    retain: true
    availability:
    - topic: "obk_wall_switch/connected"
    - unique_id: "Wall Switch 2 gang_relay_1"
    name: 1
    state_topic: "obk_wall_switch/1/get"
    command_topic: "obk_wall_switch/1/set"
    qos: 1
    payload_on: 1
    payload_off: 0
    retain: true
    availability:
    - topic: "obk_wall_switch/connected"

    Added after 2 [minutes]:

    I think I found out.. in the device naming, I used spaces
    Settings interface with options to change the device name Wall Switch 2 gang.
  • ADVERTISEMENT
  • Helpful post
    #6 20713417
    p.kaczmarek2
    Moderator Smart Home
    Hmm so Home Assistant doesn't like spaces? It's good to know.

    I can submit a fix for the core firmware so it does not allow spaces in the names. It could replace them automatically with underscores.
    Helpful post? Buy me a coffee.
  • #7 20713461
    soubhikkhan
    Level 3  

    Yes, I removed the spaces from "Full Name" and clicked on the discover again. Now the device popped up on HA!
    I should have checked the log earlier, hehe!
    Thanks for the help though!
  • ADVERTISEMENT
  • Helpful post
    #8 20713499
    p.kaczmarek2
    Moderator Smart Home
    Thank you, I was not aware about the whitespaces issue. I will submit a fix tomorrow to the main repository tree.
    Helpful post? Buy me a coffee.
  • #9 20723563
    p.kaczmarek2
    Moderator Smart Home
    Starting with 1.17.238 version of OBK, a safety check has been added to make HA discovery work even if you tried to put spaces in the names.
    Helpful post? Buy me a coffee.
  • #10 20729909
    soubhikkhan
    Level 3  
    Sounds Great! Thank you

Topic summary

The discussion revolves around issues with MQTT discovery for an Openbeacon-flashed 2 gang relay device in Home Assistant (HA). The user successfully set up MQTT topics, but the device was not discovered due to illegal characters (spaces) in the discovery topic. After reviewing HA logs, it was identified that the spaces in the unique ID caused the problem. The user removed the spaces and successfully triggered the discovery process. A suggestion was made to implement a firmware fix to automatically replace spaces with underscores in future versions. The latest firmware version (1.17.238) includes a safety check to handle such issues.
Summary generated by the language model.
ADVERTISEMENT