[SOLVED] Properly fetch MQTT states

Thanks for your long detailed post!
A few answers:

No I don’t I use the same topic, just with command and state attribute, like this:

mqtt=">[mosquitto:shellies/shelly1-056C51/relay/0/command:command:*:MAP(shelly.map)],<[mosquitto:shellies/shelly1-056C51/relay/0:state:MAP(shelly.map)]"

All of my MQTT switches follows this method, only the transform is different…

What do you mean by this? I have one Switch which can send command and updates the state of that Switch Item as well.
I have set my AllLight group to mapdb persistence with everyChange, restoreOnStartup. Is that correct? It seems working but maybe I’m missing here also something.

Didn’t know that, I haven’t read the story of it, just a few things which was required to get to know better this protocoll. However I thought that this is not mainly created for this!

Thanks!

If you have an MQTT binding config like

>[mosquitto:some/topic:state:*:some transform]

or

>[mosquitto:some/topic:*:some transform]

then then both commands and updates will be published to some/topic. You want to use command so it only publishes the message when the Item receives a command.

1 Like

Done:

2 Likes