Skip to content

Set online/offline as last will & testament #4

@Elwell

Description

@Elwell

Hopefully this is a minor change to mqtt.h connect call - see upstream docs at https://pubsubclient.knolleary.net/api#connect to add in some extra parameters

if (mqtt_client.connect(clientId.c_str(),myConfig.mqtt_username,myConfig.mqtt_password)) {

Possibly look at the way tasmota does it? they have (for example)
tele/tasmota_id/LWT Online which reverts to
tele/tasmota_id/LWT Offline when no heartbeat / keepalive detected -- this allows Home Assistant to mark the sensor as unavailable (https://www.home-assistant.io/docs/mqtt/birth_will/ for docs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions