Closed Flobul closed 9 months ago
Putting json in MQTT payload is usefull only if data inside are strongly bound together (ex : RGB payload like this {"red":128,"green":0,"blue":255} ) Otherwise, I consider it as overhead for the system that need to use it.
Ok, so it's better to use a subtopic instead?
I don't know why? and what would be the real interest for people that already currently using it? What subtopic structure do you think about?
(What would be the answer for GET+ALLS...)
Just for the method publishTick, that is not currently updated with the latest cmd/info. I implemented some of them here: Exemple for IOPT:
_haSendResult &= _mqttMan.publish((baseTopic + F("IOPT/IN_I01")).c_str(), String(IN_I01).c_str()); _haSendResult &= _mqttMan.publish((baseTopic + F("IOPT/IN_I02")).c_str(), String(IN_I02).c_str()); ...
Exemple for STDT:
_haSendResult &= _mqttMan.publish((baseTopic + F("STDT/WiFi/LABEL")).c_str(), WiFi.getHostname()); _haSendResult &= _mqttMan.publish((baseTopic + F("STDT/WiFi/GWDEVICE")).c_str(), String(F("wlan0")).c_str()); _haSendResult &= _mqttMan.publish((baseTopic + F("STDT/WiFi/MAC")).c_str(), String(WiFi.macAddress()).c_str()); ...
Exemple for ALLS:
_haSendResult &= _mqttMan.publish((baseTopic + F("ALLS/MBTYPE")).c_str(), String(MBTYPE).c_str()); _haSendResult &= _mqttMan.publish((baseTopic + F("ALLS/MOD")).c_str(), String(MOD).c_str()); _haSendResult &= _mqttMan.publish((baseTopic + F("ALLS/VER")).c_str(), String(VER).c_str()); ...
When adding those informations, put them in subtopic ALLS/... or IOPT/... or STDT/... I just edited the commit. In MQTT Explorer:
I don't know why? and what would be the real interest for people that already currently using it?
The problem is that ALLS contains infos of all others command (STAT+TMPS+...) so regarding structure, we would need to publish infos 2 times (in ALLS and in TMPS for temperatures for example)
Why?
Sure, but instead of getting STAT+TMPS+... get only ALLS + STDT. If you check modified file, you'll see I removed _Pala.getStatus _Pala.getAllTemps _Pala.getFanData to get all the informations with _Pala.getAllStatus
Hey, I changed my mind and will offer these options. What's your mind about it?
There will be 3: Generic JSON Generic Categorized Generic
baseTopic/STAT : {"STATUS":9,"LSTATUS":51} baseTopic/TMPS : {"T1":20.50,"T2":39.30,"T3":236.00,"T4":0.00,"T5":0.00} baseTopic/FAND : {"F1V":0,"F2V":0,"F1RPM":0,"F2L":7,"F2LF":2} ...
baseTopic/STAT/STATUS : 9 baseTopic/STAT/LSTATUS : 51 baseTopic/TMPS/T1 : 20.50 baseTopic/TMPS/T2 : 39.30 baseTopic/TMPS/T3 : 236.00 baseTopic/TMPS/T4 : 0.00 baseTopic/TMPS/T5 : 0.00 baseTopic/FAND/F1V : 0 baseTopic/FAND/F2V : 0 ...
(like the existing one) baseTopic/STATUS : 9 baseTopic/LSTATUS : 51 baseTopic/T1 : 20.50 baseTopic/T2 : 39.30 baseTopic/T3 : 236.00 baseTopic/T4 : 0.00 baseTopic/T5 : 0.00 baseTopic/F1V : 0 baseTopic/F2V : 0 ...
Hi. Sounds really great!
Hi, I finally released the new WPalaControl version. Lot of changes occured, I did lot of tests but if you can test it on your side, It would help me a lot. Thanks
Nicely done! Tested without issues yet.
Since lasts updates (thanks by the way :)), there are more informations that could be transmitted through MQTT.
Simple suggestion: serialize some of the datas to improved MQTT organisation (like HTTP requests) (ie: GET+STAT, GET+ALLS...)
What do you think of this idea?