volker76 / tuya_mqtt.net

MQTT Client for local Tuya devices
https://github.com/volker76/tuya_mqtt.net/wiki
Apache License 2.0
3 stars 0 forks source link

feature request: option to publish under device ID if name is set #14

Open maddhin opened 10 months ago

maddhin commented 10 months ago

Hi,

I prefer if my device is published under the device ID e.g. tuya/bf61234567mpo/Dp20 as the topics are "hardcoded" into my home automation server. In my home automation server I then name the device e.g. "kitchen light". If I move the device to the bathroom, I just have to change the name to "bathroom light" and there is no need to change the topics and commands.

Currently, tuya_mqtt.net only allows to sent the MQTT publishing topic. But if i change this topic to the device ID, it is very hard to identify the device in the GUI as only the device ID is shown. E.g. it would be good to be able to set "device name" = name that is shown in tuya_mqtt.net GUI = name coming from Tuya API. And be able to set the MQTT topic under which the devices publishes = currently existing "Given name for MQTT".

Technically this could be realized with either adding a new field "device name" or adding a switch which sets the published topic to the device ID.

Cheers for considering!

volker76 commented 10 months ago

do you mean like tuya/ceiling_lamp/Dp20 ? or even tuya/ceiling_lamp/Intensity ?

maddhin commented 10 months ago

no, in this regard, I would not change anything. I.e. the topic should stay like tuya/bf61234567mpo/Dp20

But the GUI should have the option to name the device. I.e. the device is shown as "Ceiling Lamp" in the GUI but the MQTT topics are still e.g. tuya/bf61234567mpo/Dp2 while bf61234567mpo is the device ID.