emontnemery / domoticz_mqtt_discovery

MQTT discovery plugin for Domoticz
MIT License
40 stars 28 forks source link

Data in description field #30

Open Xenomes opened 4 years ago

Xenomes commented 4 years ago

After the last update, the description field is filled with IP: mqtt info. But the already existing info is overwritten. Can you update the code to add a IP: line and update the IP: line if there is a change? Greetings Xenomes

emontnemery commented 4 years ago

Please explain the problem a bit more:

Did the problem start after domoticz update or after plugin update? Can you attach a screenshot illustrating the problem?

Xenomes commented 4 years ago

The problem started after the last update of the plugin. image Any values already existed in this field are replaced.

emontnemery commented 4 years ago

OK, that is on purpose. The idea is to make it easier to find IP address and topic of an autodiscovered Tasmota.

If you want, an option can be added to disable updating the "Description"?

Xenomes commented 4 years ago

The idea is good, only if the description already is in use, then the other plugins won´t work. If possible add your line to the existing lines in description field.

for example:

<voicecontrol>
nicknames = Alle lichten
room = Huiskamer
report_state = True
</voicecontrol>  
IP: 192.168.1.241, Topic: sonoff_AFA1F6/cmnd
emontnemery commented 4 years ago

Aha, this makes sense. Does the voicecontrol plugin accept additional data like in your example?

rrozema commented 4 years ago

XML content is likely not to accept any competing plugin/scripts content in the description field. Json however is more likely to accept competitors' content. Plus json content is very easily used and updated in any plugin or script. So I suggest to use json in the description field and ignore (leave untouched) any content that isn't yours. If you use some prefix specific to your script the chances of having a conflict with another plugin/script is even smaller.

Xenomes commented 4 years ago

Aha, this makes sense. Does the voicecontrol plugin accept additional data like in your example?

I don't know, the lines get overwritten every few minutes. Update: i did some testing DZGA (voicecontrol) can still read the codes if i add the code of de discover MQTT plugin.