MQTT - seperate server - no devices

Hello,
i configured mqtt mosquitto server on seperate server in a container.
Everything works well.
in HA i installed according to documentation mqtt device and configured it to my server. Connection is ok and i can listen messages … so all godd.
BUT under MQTT there are no devices or integrations.
What do i wrong ?

17fc833af5822ed82d9e553e8f25be9fd810703a

For Shellies, you need the Shellies discovery script

and

and for Tasmota, you need the Tasmota integration (Tasmota does not do MQTT discovery anymore)
afbeelding

@francisp
Okay thanks, I didn’t know that.
Also thanks for the links but does that mean that I have to install also python according to the documentation ? I thought I run once the script and then whenever I connect a new Shelly all is good ?
I don’t understand the procedure in behind because I come coming from a total other system and want to migrate step by step

All you need to do is put in configuration.yaml:

python_script:

  • Create the folder <config>/python_scripts
  • Add the scripts in python_scripts

Alternative is to create the shellies yourself in configuration.yaml

@francisp
May I ask the following questions because I am fully new with HA:

  1. is the folder automatically created when I put it into the config.yaml ?
  2. how do I upload a script then to this folder ?
  3. general question: all configurations I make I would like to have in different *.yaml files for better own documentation like e.g. sensors.yaml, scripts.yaml, automation.yaml and so on or what is the recommended way to do ?

No, it isn’t

Depending on your HA installation. If using HAOS you can use the Samba add-on to access from Windows/Linux/MacOS desktop, or install the file-editor add-on and cut-and-paste in a new file.

or

I use the visual studio code extension. i can make with this i would assume.

Thanks for the links i will study them !

You can also create the sensors and switches manually rather than using discovery scripts. Here’s my immersion heater control switch and a couple of sensors:

mqtt:
  switch:
    - name: "Immersion switch relay"
      command_topic: "shellies/shelly1pm-xxxxxx/relay/0/command"
      payload_on: "on"
      payload_off: "off"
      state_topic: "shellies/shelly1pm-xxxxxx/relay/0"
      state_on: "on"
      state_off: "off"
  sensor:
    - name: "Immersion switch temperature"
      state_topic: "shellies/shelly1pm-xxxxxx/temperature"
      unit_of_measurement: "°C"
      device_class: temperature
    - name: "Immersion switch power"
      state_topic: "shellies/shelly1pm-xxxxxx/relay/0/power"
      unit_of_measurement: "W"
      device_class: power

I cannot work out why you are using MQTT for a Shelly, when they have perfectly usable integration.

History: it wasn’t perfectly usable when I installed the Shelly. MQTT seems simpler and less sensitive to any future bugs in the integration.

Yes i saw this already BUT i dont know where i find the correct template for e.g. an Shelly 1pm because by myself i dont know all the things i need to put in the yaml file !

This is exactly the same for me ! Having it in mqtt everything else is possible to do and i am not “stuck” to an individual integration / addon

Look at my example, and compare with the topics you see in MQTT Explorer. You should just need to replace the xxxxxx in mine with your device IDs.

What I’ve posted above can go straight into configuration.yaml (will need a restart) although in reality mine is split up like this as there is more to my MQTT config:

# configuration.yaml
mqtt:
  sensor: !include_dir_merge_list mqtt/sensors
  binary_sensor: !include_dir_merge_list mqtt/binary_sensors
  switch: !include_dir_merge_list mqtt/switches

then, for example,

# mqtt/switches/immersion.yaml
- name: "Immersion switch relay"
  command_topic: "shellies/shelly1pm-xxxxxx/relay/0/command"
  payload_on: "on"
  payload_off: "off"
  state_topic: "shellies/shelly1pm-xxxxxx/relay/0"
  state_on: "on"
  state_off: "off"

That gives me:

image

Shelly reference here for Gen 1 devices:

https://shelly-api-docs.shelly.cloud/gen1/#shelly1-1pm-mqtt

I tried id now with one 1pm and it worked BUT I get an error in HA which says that CoIoT-Config is not working. But I have it activated.
What do I have to do ?

That is the Shelly integration, not MQTT

Mhhh, did I misunderstood something ?
I activated python scripts and put in the shelly script from link above and then I found the 3 devices.
I connected one shelly 1pm device and this message appears :frowning: What did I do wrong ?

The shelly 1pm device is one of the 3 devices, or a new one ?

No the three devices are connected still to my external mqtt server but not in the mqtt session:

So the shelly integration discovered the shelly 1pm, did not see CoIoT, and warns it needs CoIoT to be able to integrate it.

Yes but in the shelly the ColoT is activated to my external mqtt server so why does HA not see it ?

Do you run the script on HA start ?