Hello,
I just try to add my first sonoff into a sitemap, from shell the connection and receiving mqtt is fine.
On the shell I get the following answer when pressing the physical button on the sonoff:
stat/sonoff/sonoff-switch-02/RESULT {“POWER”:“OFF”}
stat/sonoff/sonoff-switch-02/POWER OFF
stat/sonoff/sonoff-switch-02/RESULT {“POWER”:“ON”}
stat/sonoff/sonoff-switch-02/POWER ON
Yes, it’s running, I allready use mqtt to get the energy (water & electricity) consumption signals (they are sendet by shell script from another Raspberry, and this works).
So I think it’s a syntax or logical error on my side (2 month ago I add my last item )
I saw my (first?) mistake,
I used: {mqtt=">[broker:cmnd/sonoff/…
But I think (saw in log and in other mqtt item) I have to user: {mqtt=">[**mosquitto:stat/**sonoff/…
In log I see:
…
_Could not update element with key tags:Switch_TV_Simulation in ManagedMetadataProviderImpl, because it does not exists.
And when controlling mqtt I see the mqtt was send (+) when pusing the button in oH, but the sonoff did not switch
(+) stat/sonoff/sonoff-switch-02/POWER OFF
stat/sonoff/sonoff-switch-02/POWER ON
that’s it, as @H102 described. The first mqtt-command sends the command (cmnd) to switch on or off, and the second command (stat) receives if update was done.
BTW for what purposes you need the metadata ?
The tags in the items e.g. [ “Lighting” ]. They are used to allow voice control with devices like Alexa. If you have no need for this you can remove the tag.
If your topic is solved, please mark it as so by clicking the square box (lower right corner) on the post that provided the solution and edit the title to start with [Solved]. This will help other with a similar issue find a quick solution.