Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
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

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

  1. ioBroker Community Home
  2. English
  3. ioBroker general
  4. RPI Pico W and MQTT Server question

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.4k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.0k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.5k

RPI Pico W and MQTT Server question

Geplant Angeheftet Gesperrt Verschoben ioBroker general
2 Beiträge 1 Kommentatoren 455 Aufrufe 1 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • M Offline
    M Offline
    MartiMan
    schrieb am zuletzt editiert von MartiMan
    #1

    Dear all,

    For my pergola I designed a servo control to follow the sun and a "dimmer setting" that allows a percentage of the sun.

    As I have a double pergola, I also have 2 controls.
    The trigonometry calculations are done in my PLC and my 2 RPI Pico W's subscribe to each the same topic "set_angle" and publish their "status".

    Communication works as expected but in ioBroker objects, the 2 devices share identical topics.

    Screenshot 2024-08-22 130920.png

    The parameters and code I use in mPython are:

    MQTT_BROKER = "rpi4.local"
    CLIENT_ID = "pergola1"
    SUBSCRIBE_TOPIC = b"set_angle"
    PUBLISH_TOPIC1 = b"status"
    
    print(f"Begin connection with MQTT Broker :: {MQTT_BROKER}")
    mqttClient = MQTTClient(CLIENT_ID, MQTT_BROKER, keepalive=60)
    mqttClient.set_callback(sub_cb)
    mqttClient.connect()
    mqttClient.publish(PUBLISH_TOPIC1, str("Homing").encode())
    mqttClient.subscribe(SUBSCRIBE_TOPIC)
    print(f"Connected to MQTT  Broker :: {MQTT_BROKER}, and waiting for callback function to be called!")
    

    I've seen duplicate devices where each gets it's own folder with each their respective states in the ioBroker objects but no idea how to do that in this case...

    Does anyone know how to get each device into their own designated folder?
    Thanks in advance!

    M 1 Antwort Letzte Antwort
    0
    • M MartiMan

      Dear all,

      For my pergola I designed a servo control to follow the sun and a "dimmer setting" that allows a percentage of the sun.

      As I have a double pergola, I also have 2 controls.
      The trigonometry calculations are done in my PLC and my 2 RPI Pico W's subscribe to each the same topic "set_angle" and publish their "status".

      Communication works as expected but in ioBroker objects, the 2 devices share identical topics.

      Screenshot 2024-08-22 130920.png

      The parameters and code I use in mPython are:

      MQTT_BROKER = "rpi4.local"
      CLIENT_ID = "pergola1"
      SUBSCRIBE_TOPIC = b"set_angle"
      PUBLISH_TOPIC1 = b"status"
      
      print(f"Begin connection with MQTT Broker :: {MQTT_BROKER}")
      mqttClient = MQTTClient(CLIENT_ID, MQTT_BROKER, keepalive=60)
      mqttClient.set_callback(sub_cb)
      mqttClient.connect()
      mqttClient.publish(PUBLISH_TOPIC1, str("Homing").encode())
      mqttClient.subscribe(SUBSCRIBE_TOPIC)
      print(f"Connected to MQTT  Broker :: {MQTT_BROKER}, and waiting for callback function to be called!")
      

      I've seen duplicate devices where each gets it's own folder with each their respective states in the ioBroker objects but no idea how to do that in this case...

      Does anyone know how to get each device into their own designated folder?
      Thanks in advance!

      M Offline
      M Offline
      MartiMan
      schrieb am zuletzt editiert von MartiMan
      #2

      @martiman OK, it was a case of RTFM :joy:

      SUBSCRIBE_TOPIC = b"set_angle" b"pergola1/set_angle"
      PUBLISH_TOPIC1 = b"status" b"pergola1/status"

      Solved...

      1 Antwort Letzte Antwort
      1
      Antworten
      • In einem neuen Thema antworten
      Anmelden zum Antworten
      • Älteste zuerst
      • Neuste zuerst
      • Meiste Stimmen


      Support us

      ioBroker
      Community Adapters
      Donate

      511

      Online

      32.4k

      Benutzer

      81.4k

      Themen

      1.3m

      Beiträge
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
      ioBroker Community 2014-2025
      logo
      • Anmelden

      • Du hast noch kein Konto? Registrieren

      • Anmelden oder registrieren, um zu suchen
      • Erster Beitrag
        Letzter Beitrag
      0
      • Home
      • Aktuell
      • Tags
      • Ungelesen 0
      • Kategorien
      • Unreplied
      • Beliebt
      • GitHub
      • Docu
      • Hilfe