Switches that come back after reload with no state shown

Hope this is the correct place, looked for a general section.
I’ve added a couple of switches that when they I reload HA yaml file they come up as per attached image. any ideas why, I’d expect them to come on as per actual state.

G

configuration.yaml entry

- command_topic: "cmnd/home/plug/reloadbench_plug/POWER1"
    name: "Reload Left"
    state_topic: "stat/home/plug/reloadbench_plug/POWER1"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    optimistic: false
    qos: 0
    retain: false
    icon: mdi:power-plug

What integration are they ? Normally they will show like the third one as soon as they receive a state.

integration : mqtt

switches are tasmotized sonoff’s.
I also execute the below on all sonoff devices

timezone 99
TimeDST 1,W,M,D,h,120
TimeSTD 1,W,M,D,h,120
Powerretain 1

G

Add this to your automations.yaml:

- id: '1565194745362'
  alias: Statusstarting HA
  trigger:
  - event: start
    platform: homeassistant
  action:
  - data:
      payload: ''
      topic: cmnd/tasmotas/status
    service: mqtt.publish

This asks the tasmotas for their status

Is that the correct trigger for:

tom_i, you are correct, it is for restart of HA

why would i need to add this for these two entities though and the other odd 50 not…

They all work correct, its these 2 and 2 others thats not.

G

Default teleperiod is 300 seconds, so they should show a normal switch after 5 minutes.

could be, but still why do they come up confused and all the others come up correctly.
they all went down together, knowing state…
– thinking… mqtt state…
G

ok, so i can do this for only one entity ? and specify it’s cmd/…/status endpoint, or make that the offending entities… ?
still would want to understand why these 4 are behaving so different from all the others.
G

please explain the command/log for me.
what i’m reading it is pushing a empty status to my status topic, nullifying it in effect.
how would that fix my problem ?
G

That command is asking all tasmota devices to publish their status.

so you saying I should use that topic exactly as is ?
don’t understand which tams device would be listening to this topic

  topic: cmnd/tasmotas/status

as none of mine are configured anything like that.
must be break in my understanding.
G

If you did not change it, tasmotas is the group all devices belong to.

see my topic right on the op.
G

here is a example of some of my topics.

 - data:
      payload: ""
      topic: stat/home/plug/reloadbench_plug/POWER1
      retain: false
    service: mqtt.publish
  - data:
      payload: ""
      topic: stat/home/plug/reloadbench_plug/POWER2
      retain: false
    service: mqtt.publish
  - data:
      payload: ""
      topic: stat/home/plug/fridgefreezersam_plug/POWER1
      retain: false
    service: mqtt.publish
  - data:
      payload: ""
      topic: stat/home/plug/fridgefreezersam_plug/POWER2
      retain: false
    service: mqtt.publish
retain: false

??? shouldn’t that be set to true in order to survive a reload ? :face_with_raised_eyebrow:

Retained messages are a valuable feature in MQTT that
mitigates uncertainty regarding message publication.
By enabling the retention of the most recent message on a topic,
subscribers can stay informed about the current state,
even during periods of inactivity.

interesting.
2 of entities behave as they suppose to with this set to false, other 2 mis behave with false and with true.
my entities are all defined with true in configuration.yaml.
My logic also say as per your comment above, but going to see what happens if this from the offending entities.
G