Configured MQTT devices works but doesn't appear in device list!

I’m deperate!
I would like to add my shelly devices over MQTT and not over ShellyforHASS anymore. Testing the connection with listening and publishing something manually works great! BUT: my integration simply diens’t want to add the devices! The Integration always looks like this:
https://i.imgur.com/6Q43UVy.jpg
No device will be shown!

The following steps has been made:

  1. added a mqtt user in homeassistant (named “mqtt”, not an admin)
  2. installed the MQTT broker over Supervisor (default configuration with no local login)
  3. I activated the automatically suggested MQTT integration (default configuration with mqtt user credentials)
  4. I activated MQTT on the shelly device (QoS: 1)
  5. Tested the connection by clicking in the mqtt integration on configure, listening to shellies/# and publishing something to switch the relais on and off. It works great!
  6. Added the device manually, adding a the code to the configuration.yaml:
- platform: mqtt
  name: Kitchen
  payload_on: "on"
  payload_off: "off"
  qos: 1
  state_topic: shellies/shelly1-E8DB84D4FC02/relay/0
  command_topic: shellies/shelly1-E8DB84D4FC02/relay/0/command
  json_attributes_topic: shellies/shelly1-E8DB84D4FC02/info

The device doesn’t show up! Why?

I already tried even more:

  • Different “Max QoS” on Shelly devices
  • Different Shelly Devices
  • Installing the “Shellies Discovery Script”: Shellies Discovery Script
  • Rebooting everything a lot of times
  • Removing everything, adding again

Can someone please help me?!

Thank you
Cas

I don’t know. What does the log say?

Nothing special, in my opinion:

2021-12-03 23:26:11 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-03 23:26:11 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration shelly which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-03 23:26:15 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook 4c07d061bf7e6008a84ee700a7991eb27e6f888f6b5c1eabe2ad3cf208b8512c from 10.0.10.118
2021-12-03 23:26:33 WARNING (MainThread) [homeassistant.setup] Setup of default_config is taking over 10 seconds.
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sp_1_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_2_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_3_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_1_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_6_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_14_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_9_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_7_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_4_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_12_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_13_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_10_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_11_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_8_total_consumption
2021-12-03 23:26:47 WARNING (MainThread) [homeassistant.components.energy.sensor] Found unexpected state_class None for sensor.sps_5_total_consumption
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.on_sunset] Initialized trigger Abends früh
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.on_sunrise] Initialized trigger Morgens früh
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.morgens_spat_aus] Initialized trigger Morgens spät
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.abends_spat_aus] Initialized trigger Abends spät
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.motion_sensor] Initialized trigger Motion Sensor On
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.motion_sensor_off] Initialized trigger Motion Sensor Off
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.new_automation] Initialized trigger Urlaubsbeginn
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.urlaubsende] Initialized trigger Urlaubsende
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.tv_an_soundbar_an_test] Initialized trigger Medien: TV an --> Soundbar an
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.tv_aus_soundbar_aus_test] Initialized trigger Medien: TV aus --> Soundbar aus
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.tv_an] Initialized trigger Medien: TV --> an (Strommessung)
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.tv_aus] Initialized trigger Medien: TV --> aus (Strommessung)
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.soundbar_an] Initialized trigger Medien: Soundbar --> an (Strommessung)
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.soundbar_aus] Initialized trigger Medien: Soundbar --> aus (Strommessung)
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.medien_tv_an_bool] Initialized trigger Medien: TV --> an (Bool)
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.medien_tv_aus_bool] Initialized trigger Medien: TV --> aus (Bool)
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.waschmaschine_ist_fertig] Initialized trigger Waschmaschine ist fertig
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.trockner_ist_fertig] Initialized trigger Trockner ist fertig
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.rgbw2_1_mix] Initialized trigger RGBW2 1 Mix
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.rgbw2_1_turn_off] Initialized trigger RGBW2 1 Turn off
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.timer_eier_2_0] Initialized trigger Timer
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.samsung_tab_s2_akku_laden] Initialized trigger Samsung Tab A7 Akku laden
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.pc_zbox_switch_on] Initialized trigger PC ZBox Switch on
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.pc_zbox_switch_off] Initialized trigger PC ZBox Switch off
2021-12-03 23:26:48 INFO (MainThread) [homeassistant.components.automation.send_actionable_notifications_when_entering_a_zone_for_android] Initialized trigger Nina Feierabend
2021-12-03 23:27:00 INFO (MainThread) [homeassistant.components.automation.pc_zbox_switch_off] PC ZBox Switch off: Running automation actions
2021-12-03 23:27:00 INFO (MainThread) [homeassistant.components.automation.pc_zbox_switch_off] PC ZBox Switch off: Executing step call service
2021-12-03 23:27:00 INFO (MainThread) [homeassistant.components.automation.soundbar_aus] Medien: Soundbar --> aus (Strommessung): Running automation actions
2021-12-03 23:27:00 INFO (MainThread) [homeassistant.components.automation.soundbar_aus] Medien: Soundbar --> aus (Strommessung): Executing step call service
2021-12-03 23:27:00 INFO (MainThread) [homeassistant.components.automation.tv_aus] Medien: TV --> aus (Strommessung): Running automation actions
2021-12-03 23:27:00 INFO (MainThread) [homeassistant.components.automation.tv_aus] Medien: TV --> aus (Strommessung): Executing step call service
2021-12-03 23:54:36 INFO (MainThread) [homeassistant.components.automation.pc_zbox_switch_on] PC ZBox Switch on: Running automation actions
2021-12-03 23:54:36 INFO (MainThread) [homeassistant.components.automation.pc_zbox_switch_on] PC ZBox Switch on: Executing step call service
2021-12-04 00:07:22 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:22 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:22 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:22 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:22 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:23 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:26 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:29 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:29 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:29 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:29 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:29 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:29 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.
2021-12-04 00:07:43 WARNING (MainThread) [frontend.js.latest.202111090] Icon mdi:flash-circle was renamed to mdi:lightning-bolt-circle, please change your config, it will be removed in version 2021.12.

I’d recommend you stop using both of those and use the core Shelly Integration. It works very well (local push), and supports discovery. Very little configuration required.

If you want to use Shellies Discovery debug log for python_script is needed.

For anything MQTT related, above your HA/device configuration, the first debugging step is to check what’s actually in you broker with a tool like MQTT Explorer

I’m not clear about your issue, but thought I would add that in HA there are “devices” and there are “entities”. In your step 6, this should create an “entity” and you should see this in your “Entities” list. This however does not create a device. HA does not allow you to yaml configure a device for the MQTT platform.

There are a couple of options you can still pursue:

  1. One is to use MQTT discovery, if Shellies support this (I don’t use Shellies, so I’m not sure). If they do, then skip your step 6 and enable it on the Shellies. Make sure mqtt discovery is yaml configured properly in HA.

  2. Fake your own MQTT discovery. Yaml configure mqtt discovery in HA. Don’t do step 6 above. Here you would use an MQTT client (you can use HA’s built in MQTT publish service for this) to generate a MQTT message on a topic that HA listens on for mqtt discovery. The MQTT message would contain all the data (JSON format) that HA would use as if it got it from a Shelly device. I don’t know but this may be what the Shellies Python Script is attempting to do.

  3. Another option is a hybrid of the above. First you yaml configure mqtt as you did in step 6, and then in addition, use an MQTT client to MQTT publish the “device” info that supplements the yaml config. I don’t know what HA won’t let you yaml configure the device. But it does support this hybrid option.

The last two options are not that easy to figure out how to do, but it can be done.

Hope this helps.

A lot of various advices, but nobody noticed that Shelly doesn’t publish info topic. It might be a reason why mqtt integration gets confused and doesn’t work.
Here is a working code for one of my Shelly1

- platform: mqtt
  name: "XMass Tree Garden"
  command_topic: "shellies/xmasstree_garden/relay/0/command"
  state_topic: "shellies/xmasstree_garden/relay/0"
  availability_topic: "shellies/xmasstree_garden/online"
  qos: 1
  retain: false
  payload_on: "on"
  payload_off: "off"
  payload_available: "true"
  payload_not_available: "false"
  optimistic: false  

Also make sure in which domain the entity is defined (in light or switch). Should work in both, but it will differ in domain.

Note, no discovery is needed. And I personally advice to not use it as well as any integration (for several reasons). Pure MQTT integration is most reliable solution.

Thank you very much for your advices. Unfortunately none of them worked and Hass still “ignores” the configuration I made. No error and no entity listing.
Because I already invested so much time I will move to the official shelly integration. MQTT sounded good to me, but unfortunately I still missing something.

Thank you
Cb