Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sonoff MQTT Structure

Featured Replies

Hi all

Comment please for those playing with Tasmota on Sonoff's and MQTT.

Video's i'm looking at talks about stat/tele or cmd and then the name.

ie

stat/home/sonoff/lounge/tv

 - so to see all stat messages for this I would subscribe to stat/home/sonoff/lounge/tv/#

tele/home/sonoff/lounge/tv

 - so to see all stat messages for this I would subscribe to tele/home/sonoff/lounge/tv/#

cmd/home/sonoff/lounge/tv

 - so to see all stat messages for this I would subscribe to cmd/home/sonoff/lounge/tv/#

but I can't subscribe to all home/sonoff/lounge/tv ...

and then the new Tasmoto FW now supports it the other way round also, namely.

/home/sonoff/lounge/tv/cmd

/home/sonoff/lounge/tv/stat

/home/sonoff/lounge/tv/tele

The 2nd makes more sense for me as I can go home/sonoff/lounge/tv/# and see everything (all messages) related to the lounge tv.

but then the first makes sense also in that i can go tele/home/sonoff/# and see all telemetry data coming from my POW R2's or stat/home/sonoff/# and see all status

Comments, ideas, advise.

G

5 hours ago, georgelza said:

Tasmota on Sonoff's

The output of the command line interface as in 4:47 . I have to say I don't know enough but I got stuck setting up a THD16 device in HA via an external MQTT on a Pi.Reading the cli gave me the info I needed. 

 

@georgelza I have always used this format 

Message Issued by Intent

cmnd

devices shown on the right-hand side

control the Sonoff; set configuration; ask for status

stat

the Sonoffs on the left-hand side

report back status or configuration message

tele

some Sonoffs (like temperature measuring devices)

report unsolicited telemetry info at periodic intervals

  • Author

ye, this are the 3 action / message options.

but do you use tele/home/sonoff/garage or home/sonoff/garage/tele ?

look at my question again, you not getting what I'm asking.

G

On 2019/05/07 at 6:58 AM, georgelza said:

do you use tele/home/sonoff/garage or home/sonoff/garage/tele ?

My TH16 device in HA :

switch:
  - platform: mqtt
    name: "Sonoff DC1 Power"
    state_topic: "stat/sonoff-XXX/POWER"
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

sensor:
  # Weather prediction
  - platform: yr
  #Sonoff
  - platform: mqtt
    name: "Sonoff DC1 Temperature"
    state_topic: "tele/sonoff-XXX/SENSOR"
    value_template: "{{value_json['SI7021'].Temperature }}"
    unit_of_measurement: "°C"
    qos: 0
  - platform: mqtt
    name: "Sonoff DC1 Humidity"
    state_topic: "tele/sonoff-XXX/SENSOR"
    value_template: "{{value_json['SI7021'].Humidity }}"
    qos: 0
    unit_of_measurement: "%"
    device_class: humidity

 

Did you set the Topic in the Sonoff Mqtt i.e. Sonoff-XXX  ?

  • Author

think we still missing each other, yes, I gave it personalised name via the web interface (see below) in the tasmoto url once it was flashed.

See the attached picture... I've configured "Client" etc etc, I've configured the "Topic" to the same name as Client.What I'm mostly asking: for full topic... this can be %topic%/%prefix% or %prefix$/%topic%, which version/option is people preferring and why.   

configure-mqtt-sonoff.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.