Code Monkey home page Code Monkey logo

Comments (6)

roncoa avatar roncoa commented on June 11, 2024 1

Tutto quello che hai detto e' corretto.
In SmartHome non ho mai usato la pubblicazione retained solo perche' non mi piace "sporcare" il broker MQTT, infatti tutti questi messaggi rimangono nel broker e si pubblicano in automatico ad ogni avvio, anche se il dispositivo non esiste piu' o e' stato programmato in modo diverso. La soluzione sarebbe eliminarli "a mano".

Tengo comunque in considerazione la tua proposta ;)

In Home Assistant ho visto anche io il problema del riavvio.
Puoi aggirare il problema creando un'automazione che all'avvio di Home Assistant pubblica sul topic "ack" il payload "ack". Questo, fa le veci del LWT Online retained in quanto ad ogni avvio di HA chiede e riceve l'ACK dei nodi SmatHome.

Ciao

from smarthome.

snakuzzo avatar snakuzzo commented on June 11, 2024

Discorso comprensibilissimo quello di non sporcare il broker ed ovviamente ok anche il discorso dell'automazione (che avevo già fatto) allo start di HA e che comunque andrebbe fatta a prescindere così come si fa per altri device configurati via MQTT (come Tasmota e Shelly). Non mi ero accorto che la pubblicazione del topic 'ack' pubblicava anche il LWT...

homeassistant/switch/807d3a3e1d5f_INT0/config {"name":"Interruttore/1","command_topic":"Interruttore/1","payload_on":"on","payload_off":"off","state_topic":"Interruttore/1/ack","state_on":"on","state_off":"off","value_template":"{{value_json.STATO}}","availability_topic":"smarthome-prova-lwt","payload_available":"online","payload_not_available":"offline","unique_id":"807d3a3e1d5f_INT0","device":{"identifiers":["807d3a3e1d5f_INT0"],"name":"Interruttore/1","model":"SmartHome","sw_version":"SmartHome V7.0beta2","manufacturer":"[email protected]"}}
ack {"MAC_address":"807d3a3e1d5f","NODO":"INT","Topic":"Interruttore/1","Topic_ACK":"Interruttore/1/ack","availability_topic":"smarthome-prova-lwt"}
smarthome-prova-lwt online

from smarthome.

antjnm avatar antjnm commented on June 11, 2024

Ciao,
anch'io ho lo stesso problema, all'avvio di Home Assistant tutti i dispositivi Smarthome risultano non disponibili.
Mi potresti spiegare meglio questa automazione.
Grazie in anticipo.

from smarthome.

snakuzzo avatar snakuzzo commented on June 11, 2024

Usa questa automazione...

- alias: 'Announce SmartHome'
  trigger:
  - platform: homeassistant
    event: start
  action:
  - service: mqtt.pubblish
    data:
      topic: 'ack'
      payload: 'ack'

allo start di homeassistant pubblica un topic 'ack' con payload 'ack' e forza tutti i device smarthome connessi al broker MQTT a pubblicare il proprio stato, incluso il topic LWT

from smarthome.

roncoa avatar roncoa commented on June 11, 2024

Usa questa automazione...

- alias: 'Announce SmartHome'
  trigger:
  - platform: homeassistant
    event: start
  action:
  - service: mqtt.pubblish
    data:
      topic: 'ack'
      payload: 'ack'

allo start di homeassistant pubblica un topic 'ack' con payload 'ack' e forza tutti i device smarthome connessi al broker MQTT a pubblicare il proprio stato, incluso il topic LWT

Perfetto, il problema nasce dal fatto che riavviando HA , non viene riavviato Mosquito.
Con l'automazione che ti hanno messo aggiri il problema 👍🏻

from smarthome.

antjnm avatar antjnm commented on June 11, 2024

ci sono riuscito!!!!!! grazie mille per la vostra disponibilità

from smarthome.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.