Closed jschroeter closed 1 month ago
What if we send debug to <mqtt-tx-topix>/debug
?
Should be most easiest solution to implement :smile:
To not confuse Home Assistant, MQTT Explorer and possibly other tools, we should:
{"debug": "Received data from bus"}
For MQTT, I do like your idea of moving all debug output into a separate topic. Easy to implement + less conflicts, e.g. no risk of breaking smart home automations while debug mode is on.
For serial, I would say we mix normal and debug output like we do now. As long as we take care about the two points above, we're good. The only thing I'm wondering is if we should merge both JSONs like I initially suggested above, it seems weird to send two partly similar JSONs for one and the same bus event. So we could also do the following: if debug mode is on, the raw
field is added to the regular bus event JSON (for MQTT and serial). So only the debug messages like "GDOOR Setup start", "Received data from bus" etc. are sent to the MQTT debug topic. Does this make sense?
I would not send debug output messages via MQTT (as it should be with no Wifi dependency which may break in a debug case). Rest is implemented in #16
Not urgent but I think we should invest the effort to only send 1 JSON per event. Initially I thought only Home Assistant gets confused when sending multiple, but it seems that MQTT Explorer also doesn't recognize the JSON format if Gdoor debug mode is enabled: