Emoncms v10.2.1 New MQTT Topic Filter Issue

Might this be a breaking change?

I dont think its a breaking change, but may cause new inputs to appear for some users posting MQTT data with extended topic strings. Whereas previously these inputs would have been conflated together into a non functional input.

1 Like

@TrystanLea It is…

Pre update

Post update

Bugger.

The old mechanism simply discarded the topics below a certain level!

[edit]
These topics

image
are no longer received…

Hello @borpin

Not so fast then! :slight_smile:

A quick script to test here suggests that those topics should work:

import time
import paho.mqtt.client as mqtt

mqttc = mqtt.Client("topic_test")
mqttc.username_pw_set("emonpi", "emonpimqtt2016")
mqttc.connect("192.168.1.64", 1883, 60)
mqttc.loop_start()
while 1:
    mqttc.publish("emon/xiaomi4c:65:a8:d8:de:98/battery",3.3,2)
    mqttc.publish("emon/xiaomi4c:65:a8:d8:de:98/humidity",56.6,2)
    mqttc.publish("emon/xiaomi4c:65:a8:d8:de:98/temperature",19.6,2)
    print "."
    time.sleep(10)

mqttc.loop_stop()
mqttc.disconnect()

image

I wonder what the difference is between your system and mine?

:exploding_head: :exploding_head: Never make 2 changes at once - Apologies, @TrystanLea entirely my fault. this one.

But the additional _state in the Input name is a breaking change. I think the additional topic levels must have been discarded before.

Good to hear its working!

yes i think that was the case. If you would have had two similar topics one /state and another /value they would have written on top of each other… are you happy with the steps required to remap this new input?

Yes but it should be highlighted as a breaking change. In my case there was only one topic so it was not overwritten (though that had happened before).

The idea is sound but I think should have had an attached setting to enable/disable it to avoid it being a breaking change.

1 Like