Changing the /temperature mqtt topic

Hi all, my issue is the following. BME280 is not an accurate sensor for temperature, however it’s useful for pressure and humidity. So in essence I’d like to use a dallas sensor for temperature and a bme280 for humidity/pressure. Problem is that both these usermods publish to the /temperature topic so I can’t in essence create 2 sensors in Home Assistant. What’s the easy way to solve this if any? Thanks.

not much you can do about that without changing any code, except to order many BME sensors and pick the one that is most accurate.

Thanks for your answer. I don’t mind changing code if someone could point me to the files involved. The problem with the bme280 is that it’s not really a temp sensor as it states in the datasheet. It ‘estimates’ temp to be able to measure pressure and humidity more accurately.

change it here:

there the topic name is set.
the BME280 has a temperature sensor inside, it is just less accurate than the dallas one but it should be within +/- 1°C

Thanks for your input, I should have imagined that’s the file I have to edit. All my bme280s (3 of them) are 3-4 degrees off, have two 5v and two 3.3v from the same seller admittedly so maybe that’s the culprit? Excuse my ignorance but let me ask anyway. I understand I need to change this for example to something else than “temperature”:

But do I also have to change “Temperature”? Like above and here?

Cheers!

long time since I used mqtt… the local variable name is irrelevant, what gets sent out is here I think: WLED/usermods/BME280_v2/usermod_bme280.h at 0bcdc9641dbb8c233ddf6cf4b05080e882171f81 · Aircoookie/WLED · GitHub

That looks promising actually, I’ll give it a go! Thanks for your help!