NEWS
RPI Pico W and MQTT Server question
-
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.

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! -
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.

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!
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden
