(SOLVED)OpenHabian 2 MQTT Item

Hi ,i need to use a “switch” item ,but i need a switch like a digital button not to stay ON or OFF,but to give the command and return to the initial state. Any help ? THX

Have you seen

and the autoupdate feature ?

You can also use a proxy switch and a rule that when the switch turns on have it send a command then turn back off. I can provide an example if needed.

Or in the sitemap:

Text item=mySwitch mappings=[ON="ON"]

And the item:

Switch mySwitch { autoupdate="false" }

You can use expire binding

Switch Wallplug_FF_LR_TV "Wallplug TV" <poweroutlet> { channel="zwave:device:bb4d2b80:node30:switch_binary"; expire="1s,command=OFF" }

So many options, the great thing about OH.:grinning: If your just starting out with OH I recommend to try them all. Nothing better for learning than to jump in try a little of everything.

yes pls

It`s not working (my fault probably),i will try whit a rule.This is my Switch :slight_smile:

Switch PowerReleu1 "Power Releu 1" <Power> [ "Switchable" ] {mqtt=">[broker:SmartHome/Power/Releu1:command:ON:Z3ON],>[broker:SmartHome/Power/Releu1:command:OFF:Z3OFF],<[broker:SmartHome/Power/Releu1/state:state:ON:Z3ON],<[broker:SmartHome/Power/Releu1/state:state:OFF:Z3OFF]", autoupdate="false"}