MQTT switch "This entity does not have a unique ID" error

I’ve got a few Tasmota devices which I want to add to Home Assistant. I tried auto discovery but making changes to those devices or even removing them was very difficult. So I’ve decided to configure them manually.

I’ve got a following config for the switch:

switch bathroom_socket_switch_1:
  - platform: mqtt
    name: "Bathroom Socket Switch 1"
    icon: "mdi:power"
    state_topic: "tasmota/bathroom/stat/POWER1"
    command_topic: "tasmota/bathroom/cmnd/POWER1"
    availability_topic: "tasmota/bathroom/tele/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true

The switch gets added in Home Assistant and can be toggled, however if I go to Configuration > Entites and try to open the switch, this is what I get:
image

I had the same problem with MQTT sensors - “This entity does not have a unique ID”, but I’ve solved that by adding unique_id in their config. Switches do not support unique_id so I’m at loss. What are my options to fix this or is this supposed to be like that?

Here is my configuration of a switch with tasmota… Mention that state_topic and command are identical and slightly different from yours… I hope this will help you…

  - platform: mqtt
    name: "Hall Etage AR"
    state_topic: "cmnd/hall_ar/POWER1"
    command_topic: "cmnd/hall_ar/POWER1"
    icon: mdi:lightbulb
    retain: true

Thank you! If you could check under Configuration > Entities > Hall Etage AR whether you also get “This entity does not have a unique ID”, that would help me get some understanding of how this works.

What are you trying to change in the “configuration->entities” section that you need editing capabilities there?

Same behaviour “This entity does not have a unique ID” but for me it is a normal situation as your entity has been configured manually… so you cannot change the name through that panel for example… change it in the switch.yaml file if you want…

You have to look at the following release notes for version 0.106 for more details…(see paragraph “Entities configuration panel now shows all entities”)

Ok, thank you! I did not know this was expected behavior as I didn’t see it documented anywhere. What confused me additionally was the fact that I could give unique_id to sensors but not switches.

Actually, they do. I’ve been using unique_id for some of my switches for a long time.

Here’s a portion of my Entities view:

  • Both entities are MQTT Switches configured in switches.yaml.
  • switch.furnace_fan is not assigned a unique_id so the view uses the “no pencil” icon to indicate it cannot be edited (from this view).
  • switch.morning is assigned a unique_id and can be edited from the view.

Screenshot from 2020-03-12 18-15-42

3 Likes

Ok, this is very interesting! Thank you! This means the switch documentation needs to be updated:

Unlike switch documentation, sensor documentation has unique_id listed as available setting:

@123 I created this account to thank you for this answer. Giving all stuff unique ids should be advocated for in the documentation.

2 Likes

i think hassio is a stupid platform. the first time i used it had a bug without fixing for a long time. now i try to use it again and facing this stupid error … anw a stupid thing …

The stupid thing is : it is not even an error. Just a warning that you can’t manage the entity from the UI, you need to manage it from yaml.

1 Like