Skip to content

Conversation

@olegbilovus
Copy link
Contributor

Add the option to publish each sensor on a different MQTT topic.

Some MQTT Dashboard applications such as IoT MQTT Panel do not support to filter the data by the values inside the message and to work properly, they need that the data is published on different topics.

When the option is enabled, it will publish to android/sensor/{sensorEvent.type}.
E.g.: The Magnetometer sensor will publish to android/sensor/android.sensor.magnetic_field

TODO: the Settings screenshot in the README.md should be updated.

@UmerCodez
Copy link
Owner

Some additional tasks need to be completed:

  1. When the user enables dedicated topics, the sensor list screen should be updated accordingly. For example, type = android.sensor.accelerometer should be replaced with topic = android/sensor/accelerometer.

  2. When dedicated topics are enabled, the payload should no longer include the type field.

@olegbilovus
Copy link
Contributor Author

olegbilovus commented Nov 17, 2025

Some additional tasks need to be completed:

1. When the user enables **dedicated topics**, the sensor list screen should be updated accordingly. For example, `type = android.sensor.accelerometer` should be replaced with `topic = android/sensor/accelerometer`.

2. When dedicated topics are enabled, the payload should no longer include the `type` field.

I removed the "type" from the json and added the "topic" to the sensors lists when Dedicated Topic is enabled

@UmerCodez
Copy link
Owner

Let me test it !

@UmerCodez
Copy link
Owner

UmerCodez commented Nov 18, 2025

The app is crashing on changing topic as you haven't merged #3 in this branch

Edit: Okay no need to do this, it will be fine when i merge this into main

@olegbilovus
Copy link
Contributor Author

The app is crashing on changing topic as you haven't merged #3 in this branch

Edit: Okay no need to do this, it will be fine when i merge this into main

I merged main into this branch to be sure it still works also with the new dependency updates and to test the topic change without crashing the app.


Without closing the app, if you use topic 1, connect, disconnect and then change to topic 2 and connect again, look at the mqtt messages, you will more easily the Issue #1 where it will send messages also to the old topic.

@UmerCodez
Copy link
Owner

Without closing the app, if you use topic 1, connect, disconnect and then change to topic 2 and connect again, look at the mqtt messages, you will more easily the Issue #1 where it will send messages also to the old topic.

Yes i noticed that issue. I am debugging the app to find the cause !

@UmerCodez UmerCodez merged commit 253d89a into UmerCodez:main Nov 19, 2025
1 check passed
@olegbilovus olegbilovus deleted the feat-mqtt_dedicated_topics branch November 19, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants