Closed bakman2 closed 1 year ago
Hi @bakman2
As you can see here for instance there is a topic
setting for each accessory type and from which every MQTT topics is derived according to the default tasmota settings.
For instance, in one of my switch I have in the topic
settings veranda_switch_ceiling
(without slash) which will result in the following MQTT topics:
tele/veranda_switch_ceiling/STATE
stat/veranda_switch_ceiling/RESULT
cmnd/veranda_switch_ceiling/POWER
As far as I understand from your settings, the topic is tasmota/kleine_kamer/fan
so the device will listen/publish on theses topics:
tele/tasmota/kleine_kamer/fan/STATE
stat/tasmota/kleine_kamer/fan/RESULT
cmnd/tasmota/kleine_kamer/fan/POWER
If this is right, then setting topic
to tasmota/kleine_kamer/fan
in your accessory json file will be good enough:
{
"accessory": "mqtt-tasmota",
"type": "lightbulb",
"name": "Mein Kleine Kamer",
"url": "mqtt://192.168.50.15",
"topic": "tasmota/kleine_kamer/fan"
}
Thanks for your response.
Perhaps I should have clarified that I was referring to the %prefix%
.
The topics will become:
tasmota/kleine_kamer/fan/cmnd/POWER
tasmota/kleine_kamer/fan/tele/STATE
...
Ok understood. Then the only one way to setup the device is to explicitly type all topics in the configuration file. Since your device looks like a fan, you can find all topics related to fans here
In your example, it could be:
{
"accessory": "mqtt-tasmota",
"type": "fan",
"name": "Mein Kleine Kamer",
"url": "mqtt://192.168.50.15",
"resultTopic": "tasmota/kleine_kamer/fan/stat/RESULT",
"commandTopic": "tasmota/kleine_kamer/fan/cmnd/FANSPEED",
"commandStateTopic": "tasmota/kleine_kamer/fan/cmnd/STATE",
"teleTopic": "tasmota/kleine_kamer/fan/tele/STATE"
}
I can probably add a new parameter, like "fullTopic": "%prefix%/%topic%/"
or "fullTopic": "%topic%/%prefix%/"
to ease the process, let me have a look
Released, now you can set your accessory with:
{
"accessory": "mqtt-tasmota",
"type": "fan",
"name": "Mein Kleine Kamer",
"url": "mqtt://192.168.50.15",
"topic": "tasmota/kleine_kamer/fan",
"fullTopic": "%topic%/%prefix%/"
}
@AtomBaf it works nicely thanks. One issue though, if you add a new accessory via GUI, the "fullTopic": "%topic%/%prefix%/"
gets removed from the config for all accessories.
thx for spotting this @bakman2, it is now fixed as of version 0.9.0
I am using a different prefix (because i dislike the default topic setup from tasmota)
This does not seem to work with this plugin.
I enabled the "debug" option, where am I supposed to the see the output ? In the default homebridge log ? Don't see anything there.