Skip to content

MQTT should report when it connects to the broker #65

Closed

Description

@kendersec

I'd like to turn other things on when the ESP with WLED is turned on and connects to the broker. Espurna seems to ocassionally report the status of the system and also when first connected. Would you consider doing something similar?

This is what I get from Espurna:

courtyard/floodlight/app ESPURNA
courtyard/floodlight/version 1.13.2
courtyard/floodlight/board ITEAD_SONOFF_BASIC
courtyard/floodlight/host COURTYARD-FLOODLIGHT
courtyard/floodlight/ip 192.168.0.202
courtyard/floodlight/mac B4:E6:2D:3A:BF:E6
courtyard/floodlight/rssi -89
courtyard/floodlight/uptime 596446
courtyard/floodlight/datetime 2018-10-30 21:55:18
courtyard/floodlight/freeheap 23488
courtyard/floodlight/relay/0 1
courtyard/floodlight/vcc 3187
courtyard/floodlight/status 1
courtyard/floodlight/loadavg 1

Activity

  1. Aircoookie commented on Oct 30, 2018

    @Aircoookie
    Member

    Hi, by "report" do you mean that the ESP should publish to a certain topic that it is connected now?
    That would actually make a lot of sense. If it is enough for you if WLED publishes the current state to the /device/g and /device/c topics and your other things subscribe to those topics, you can just add publishMQTT() below line 83 (mqtt->subscribe(subuf);) in wled17_mqtt.ino and it will not only update when it changes color/brightness, but also when it initially (re)connects to the broker. I will also add this behavior in the upcoming 0.8.1 version.

  2. kendersec commented on Oct 30, 2018

    @kendersec
    Author

    Yes, I think publishing current state to /device/g and /device/c on boot would work/make sense. Thanks!

  3. Aircoookie commented on Nov 18, 2018

    @Aircoookie
    Member

    This feature should work as intended now. If there are any further issues, feel free to reopen!

  4. added a commit that references this issue on Apr 8, 2020
  5. added a commit that references this issue on Aug 24, 2023
  6. added a commit that references this issue on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions