Tasmoto MQTT device not showing in States or UI

Hi all i have three tasmoto device connected with mqtt, i can see that they have conencted in the mqtt broker but the States or UI n ot showing them,

here is the config info am i doing something wrong

switch:
  - platform: mqtt
    name: "fishtank"
    state_topic: "stat/fishtank/POWER"
    command_topic: "cmnd/fishtank/POWER"
    availability_topic: "tele/fishtank/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false 

  - platform: mqtt
    name: "Office"
    state_topic: "stat/Office/POWER"
    command_topic: "cmnd/Office/POWER"
    availability_topic: "tele/Office/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false

Please format your code so others can confirm its indentation is correct.

How would i do that? and are you able to help me at all

I am helping you. If you don’t format your code, others cannot determine if its failure is simply due to an indentation error.

You have two choices, select the code and click the formatting icon </>. Alternately, put three consecutive back-quotes ``` on a separate line before the code. Then put three consecutive back-quotes on a separate line after the code.

All text-formatting in this community forum is based on markdown.

https://commonmark.org/help/tutorial/index.html

All done thanks for letting me know

The formatting helps to confirm the configuration is properly indented.

Are you saying switch.fishtank and switch.office fail to appear in the States page?

Did you restart Home Assistant after adding the two switches to configuration.yaml?

hi mate yep they are not showing at all, i have reset a few times and looked at config a line at a time and looks ok, i am no expert

1558526196: New client connected from 192.168.1.101 as fishtank-Sonoff (c1, k10, u’adam’).
1558525821: New client connected from 192.168.1.121 as Office-Sonoff (c1, k10, u’adam’).

Here the thing, as long as the indentation and syntax are correct and even if the topic is wrong or not receiving any messages, the switch’s configuration will be recognized by Home Assistant and it will appear in the States page. I copy/pasted your fishtank configuration to my system, restarted it, and here it is in the States page:

Screenshot%20from%202019-05-22%2008-12-46

The fact that it is not appearing in your system suggests something may be amiss with where it was defined. Do you have any other switches defined in configuration.yaml and do they appear in the States page? What other entities have you defined (that appear in the States page)?

OK i went for a coffee and back and its there i dont know why but its working :slight_smile:

Must have been a really strong cup of coffee.

lol i know lol thanks for the help anyway mate