Perdita stato al riavvio di home assistant

buongiorno a tutti sono nuovo e ho istallato hassio su raspberry p3 ho un problema che non riesco a risolvere al riavvio di home assistant gli interruttori che in stato ON risultano OFF ma fisicamente si trovano in ON

Welcome to the forums. Please post in English.

good morning everyone is new and I have installed hassio on raspberry p3 I have a problem that I can’t solve when restarting home assistant the switches that in ON state are OFF but physically are in ON

You will need to let us know what integration you are using for these switches.

mqtt mosquitto

I think you need to add the retain flag.

scusami non sono tanto pratico ho iniziato da poco a usare assistant se mi dici quale è il flag grazie

Have a look at the documentation - you are looking for retain: true / Dai un’occhiata alla documentazione - cerca retain: true

ho provato non funziona ho questa configurazione:

  • platform: mqtt
    name: “Riscaldamento”
    state_topic: “stat/Riscaldamento/RESULT”
    value_template: “{{ value_json.POWER }}”
    command_topic: “cmnd/Riscaldamento/POWER”
    availability_topic: “tele/Riscaldamento/LWT”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    payload_available: “Online”
    payload_not_available: “Offline”
    retain: true

Sei invitato a scrivere in inglese. Altrimenti ti troverai senza risposte. Puoi benissimo usare un traduttore online
Come ho appena fatto.

You are invited to write in English. Otherwise you will find yourself without answers. You can very well use an online translator
As I just did.

I tried it doesn’t work I have this configuration:

platform: mqtt
name: “Heating”
state_topic: “stat / Heating /
RESULT “value_template:” {{value_json.POWER}} "
command_topic: “cmnd / Heating / POWER” available_topic
: “Tele / Heating / LWT”
qos: 1
payload_on: “ON”
payload_off: “OFF”
payload_available: “Online”
payload_not_available: “Offline”
preserve: true

incollo in inglese e lo traduce in italiano

This is correct.

This isn’t. Have you sent your configuration through the translator?

Also, please format your configuration snippets properly so that we can see line breaks and indentations. To do that, select the YAML code, and click the </> button.