HA get wrong entity_id from esphome device? state "not available" but works

Hello,
i configured an esp with esphome and sensors and led’s. He only talks to the HA via mqtt. In my HA==> mosquitto-device-config I can see the 5 entities. 2 are in the status “ok” and 3 “not available”. However, I can use all 5 with node-red. I almost think it’s just the respective esphome entry name:
my esphome code section DHT22 (state is ok, and i get now connection-error in HA

sensor:
# DHT22 Temp/Humidy Sensor
  - platform: dht
    pin: D0
    model: AM2302
    update_interval: 30s
    temperature:
      name: "Temperatur"
      id: temperatur 
      state_topic: AnzuchtBox/DHT22/Temperatur/state

at the same esp there
my LED section ( i get the conection-error in HA State)

light:
  - platform: monochromatic
    name: "AnzuchtBox 3500K Mitte"
    output: "PWM0"
    # Optional variables:
    retain: false
    discovery: true
    availability:
      topic: AnzuchtBox/3500K_LedMitteOnline
      payload_available: online
      payload_not_available: offline
    state_topic: AnzuchtBox/3500K_LED_Mitte/state
    command_topic: AnzuchtBox/3500K_LED_Mitte/command
    command_retain: false

i see only one different
my spelling
name: “Temperatur”
to
name: “AnzuchtBox 3500K Mitte”

is that possible HA don’t like spaces and like only a-z,A-Z,_,- ?

best regards
Achim

edit:
at the esphome code above i use for pwm a pca9685 multiplexer !

i change now the section in my esphome code to try what’s happen if i change it

- platform: monochromatic
    name: "Anzuchtbox-5000K" # bevore "Anzuchtbox 5000K" with a space 
    output: "PWM2"
    # Optional variables:
    retain: false
    discovery: true
    availability:
      topic: AnzuchtBox/5000K_LedOnline
      payload_available: online
      payload_not_available: offline
    state_topic: AnzuchtBox/5000K/state
    command_topic: AnzuchtBox/5000K/command
    command_retain: false

if i delete the entities in the mqtt device
then i get now 1 error there more
i wonder… because the DHT-section there and the entity “Temperatur” and “Luftfeuchtigkeit” show all ok…
i don’t understood why, because in node-red if i try to switch off/on the light… works very well…
But only the device -manager and the mqtt-entities looks like wrong

why?


he show me now 2 light.anzuchtbox_5000k and light.anzuchtbox_5000k_2 entities_ID
why?
what i do ===>

  • i change the name in esphome
  • i stop the mqtt device with his entities
  • i delete all wrong entitis
  • i restart HA
  • i activate the device in mqtt

then i get 1 entry entitis_id more but all light entities looks like wrong

is this the wrong category for my question? I didn’t find any special category for mqtt and ha.
Please average then I’ll ask a moderator if he can move it…
Thanks