Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. Mysensors mqtt gateway (noob question).

Mysensors mqtt gateway (noob question).

Scheduled Pinned Locked Moved Development
2 Posts 2 Posters 906 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    capibara
    wrote on last edited by
    #1

    Hello !
    I'm a newbie on mysensors. it seems very interesting, but I was not able to fully understand how it works.

    I'm building my own weather station, based on MQTT and weewx.
    I was wondering if I could use the arduino mysensors lib to make the sensor management easier.

    I have some question regarding the MQTT gateway.

    How is the mqtt topic build exactly ?
    From my understanding and what I have see on the website, it seems to be this way:

    1/ it should be defined a topic prefix, ex mygateway1-out
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"

    2/ The sensors are published with as topic, something like this:
    mygateway1-out/x/x/x/x/x

    Is this correct ? is the xxx some kind of id ?

    Also, for an easier management and also because I use some sensors that would not use mysensors, I wish to use my own mqtt topic structure.
    Is it possible to do this using mysensors ? or shall I build my own software for MQTT management ?

    The topics I would like to use looks like this:
    /weewx/outTemp
    /weewx/rain
    etc...

    Best regards,

    B 1 Reply Last reply
    0
    • C capibara

      Hello !
      I'm a newbie on mysensors. it seems very interesting, but I was not able to fully understand how it works.

      I'm building my own weather station, based on MQTT and weewx.
      I was wondering if I could use the arduino mysensors lib to make the sensor management easier.

      I have some question regarding the MQTT gateway.

      How is the mqtt topic build exactly ?
      From my understanding and what I have see on the website, it seems to be this way:

      1/ it should be defined a topic prefix, ex mygateway1-out
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"

      2/ The sensors are published with as topic, something like this:
      mygateway1-out/x/x/x/x/x

      Is this correct ? is the xxx some kind of id ?

      Also, for an easier management and also because I use some sensors that would not use mysensors, I wish to use my own mqtt topic structure.
      Is it possible to do this using mysensors ? or shall I build my own software for MQTT management ?

      The topics I would like to use looks like this:
      /weewx/outTemp
      /weewx/rain
      etc...

      Best regards,

      B Offline
      B Offline
      bgunnarb
      wrote on last edited by
      #2

      @capibara
      Yes, you are getting there!
      The topic prefix is just as you say defined by the #define statement.
      The rest of the topic is defined as described in the API definition (Serial protocol) so:
      /node-id/sensorchild-id/command/ack/type/
      The content of the message is the payload.
      Example: this is copied from my GW:
      ib9sensors-out/21/2/1/0/4 1014 => So the sensor id is 21/ the child is 2/ this is a "set" message/ no-ack/ payload type is V_PRESSURE. The content of the message is 1014 which is just the atmospheric pressure here today.
      I recommend using an MQTT client test tool like MQTT.fx It helps a lot when debugging.

      I am not the right guy to answer how to re-define the topic structure. I guess you will have to do some serious work on the MQTT GW software.

      I have never been so busy since I retired!

      1 Reply Last reply
      1

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      13

      Online

      12.1k

      Users

      11.2k

      Topics

      113.4k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular