jziolkowski / tdm

GUI application to discover and monitor devices flashed with https://github.com/arendst/tasmota
GNU General Public License v3.0
659 stars 83 forks source link

Use of topics with backlash #260

Closed vmiceli closed 7 months ago

vmiceli commented 7 months ago

Hello,

Is perhaps TDM not too happy with backlash? I have a client device that has the following message in the MQTT broker:

Waveshare\AquareaPub {"SystemOnOff":0,"OutdoorTemp":8,"OutgoingWaterTemp":49,"IngoingWaterTemp":48,"OperatingMode":1,"WorkingMode":0,"PowerComsumption":20,"LastErrorCode":0,"ErrorHystory":156,"DefrostStatus":0,"BoosterStatus":0,"CompressorFrequency":0,"BoosterStatus":0,"CompressorOperatingHours":686,"QuietMode":0,"HeatherStatus":0,"HeaterMode":0,"AlarmStatus":0,"PumpSpeed":3,"AntiFreezing":170,"BoosterHeather":32768}

so the topic is using backlashes.

I haven't been able to add a pattern that makes TDM recognise the device... actually after entering as custom pattern Waveshare\AquareaPub/% TDM is crashing at startup (I guess I'll have to reinstall it).

Thank you!

V,

barbudor commented 7 months ago

You can find tdm.cfg config file and edit it with a text editor to remove the pattern

Backslashes and slashes are bad idea in topics You should stick with letters, digits and use -or _ as separators

jziolkowski commented 7 months ago

First of all, is that payload a tasmota response? What does the log say? You can enable debug (see project wiki) and see more details.

Also there isn't anything in TDM that would actively prevent anyone from using backslash.

jziolkowski commented 7 months ago

Also Waveshare\AquareaPub/% is wrong on many levels and has no chance of working.

Jason2866 commented 7 months ago

Tasmota does not support backslash or other special characters in topic. Many functions in Tasmota will simply not work when doing this. It makes no sense for TDM to support something which is not supported in Tasmota.

jziolkowski commented 7 months ago

I'm definitely against supporting it whatsoever. I'm just curious 😉

vmiceli commented 7 months ago

You can find tdm.cfg config file and edit it with a text editor to remove the pattern

Backslashes and slashes are bad idea in topics You should stick with letters, digits and use -or _ as separators

Thanks Barbudor. Editing the tdm.cfg in my c:\users\myusername allowed mr to make it work again. Cheers.

V

vmiceli commented 7 months ago

First of all, is that payload a tasmota response? What does the log say? You can enable debug (see project wiki) and see more details.

Also there isn't anything in TDM that would actively prevent anyone from using backslash.

Hello,

no that device is not a Tasmota device, but it is under my control when it comes to its MQTT config. I just happened to config it that way.

Here is for example the MQTT broker receiving a Tasmota device message from the dishwasher and the aquarea (my problem device).

the format of the two transmissions is:

tele/Dishwasher_8F61C4/SENSOR {.... Waveshare\AquareaPub {....

Not sure if the backlash is the problem or not following the format %prefix%/%topic%/

tele/Dishwasher_8F61C4/SENSOR {"Time":"2024-01-20T19:35:31","ENERGY":{"TotalStartTime":"2023-01-16T09:53:35","Total":385.414,"Yesterday":0.828,"Today":3.008,"Period": 0,"Power": 0,"ApparentPower": 0,"ReactivePower": 0,"Factor":0.00,"Voltage":231,"Current":0.000}}

Waveshare\AquareaPub {"SystemOnOff":0,"OutdoorTemp":8,"OutgoingWaterTemp":49,"IngoingWaterTemp":48,"OperatingMode":1,"WorkingMode":0,"PowerComsumption":20,"LastErrorCode":0,"ErrorHystory":156,"DefrostStatus":0,"BoosterStatus":0,"CompressorFrequency":0,"BoosterStatus":0,"CompressorOperatingHours":686,"QuietMode":0,"HeatherStatus":0,"HeaterMode":0,"AlarmStatus":0,"PumpSpeed":3,"AntiFreezing":170,"BoosterHeather":32768}

I was trying to understand if there is something fundamentally wrong with the way my MQTT payload for the Aquarea is setup (even if it works flawlessly with NodeRed and Grafana) or if am creating the wrong autodiscovery pattern in TDM, or finally if there is a limitation in TDM that will prevent me from subscribing TDM to the aquarea topic as it currently is.

Thanks!

V.

jziolkowski commented 7 months ago

Oh boy.

For TDM to discover the device, you need the following:

(soon TDM will support native tasmota discovery, which arguably would be easier to mimic, but it's in my local test branch for now)

And this is only the discovery part. To make TDM functional with the device, status 0 is published and it's expected to be returned matching Tasmota payloads. Periodic STATE messages are needed to.

Not to mention that the \ is not supported either.

All in all, TDM is doing what's expected, I see no issue here. I get what you want to achieve here, but you will have to spend a lot of time to setup mimicking of tasmota responses to make it talk with TDM.

vmiceli commented 7 months ago

Thanks Jacek,

that makes perfect sense. I was assuming it was just as simple as a backlash but as you outlined there is a bit more :-). I can make the aquarea server mimic the tasmota's message I guess so I know now what I need to match.

Thank you again and thanks for creating TDM!!

V.

barbudor commented 7 months ago

@vmiceli it's not only about mimicking one or 2 messages, but if your firmware doesn't also answer same commands as Tasmota with proper response, then I don't see much what TDM will bring to you.

Check in your broker all what happens between TDM and a Tasmota device to see how they engage conversation.

So why not tasmotizing your Aquarea...