Question for changing switch

I have a switch for my front door to open on my default sitemap:
Switch item=FrontDoorOut label="FrontDoor: " icon=“frontdoor”

works fine with http binding, but I had some unintentionally clicks. So I want a question before switching. how can this be done ?
thanks in advance

Use the Telegram binding - scroll to the bottom of this page for a question/answer example:

You can do this by setting up a proxy item. With this configuration only if the security trigger is turned on the real item gets shown. Then you can trigger that.

Items:

Switch    System_RestartOpenHABTrigger                      "Sicher?"                                            <settings>    {channel="exec:command:Command_OpenHAB_Reboot:run"}
Switch    System_RestartOpenHABSafety                       "Restart"                                            <settings>

Sitemap

Switch item=System_RestartOpenHABSafety
Switch item=System_RestartOpenHABTrigger mappings=[OFF="NEIN", ON="JA"] visibility=[System_RestartOpenHABSafety==ON]

In addition you need this rule to turn the security item off when the real item gets triggered

rule "Reboot OpenHAB zurücksetzen"
when
    Item System_RestartOpenHABTrigger received command
then
    System_RestartOpenHABSafety.sendCommand(OFF)
end

ok, thanks for your reply.
I want to use it for my FrontDoor:
how can I use this. actually my item:

String FrontDoorOutValue { http="<[beckhoff:2000:JSONPATH($.FrontDoor)]" }
Switch FrontDoorOut { http=">[ON:POST:https://raspberrypi/beckhoff/xxx.php?frontdoor=true{Authorization=Basic xxx==}] >[OFF:POST:https://raspberrypi/beckhoff/postdata.php?frontdoor=false{Authorization=Basic xxxx==}]" }

my rule:
rule “frontdoor1”
when
Item FrontDoorOutValue received update
then
FrontDoorOut.postUpdate(if(FrontDoorOutValue.state == “on”) ON else OFF)
end

my sitemap:
Frame label=“doors” {
Switch item=FrontDoorOut label="FrontDoor: " icon=“frontdoor”
}

Do I have to use my FrontDoorOut Switch to change with your SystemRestartOpenHABTrigger ?

If you just want two clicks to lock or unlock your door, nest the door item in a text item on your sitemap.

    Text item=FrontDoorOut label="Front Door" icon=“frontdoor” {
        Switch item=FrontDoorOut label="FrontDoor: " icon=“frontdoor”
    }
1 Like

First of all: Please use code fences


Here are your configurations:
*.items

String FrontDoorOutValue { http="<[beckhoff:2000:JSONPATH($.FrontDoor)]" }
Switch FrontDoorOut { http=">[ON:POST:https://raspberrypi/beckhoff/xxx.php?frontdoor=true{Authorization=Basic xxx==}] >[OFF:POST:https://raspberrypi/beckhoff/postdata.php?frontdoor=false{Authorization=Basic xxxx==}]" }
Switch FrontDoorSafety 

*.sitemap

Switch item=FrontDoorSafety 
Switch item=FrontDoorOut label="FrontDoor: " icon=“frontdoor” visivbility=[FrontDoorSafety==ON]

*.rules

rule “frontdoor1”
when
    Item FrontDoorOutValue received update
then
    FrontDoorOut.postUpdate(if(FrontDoorOutValue.state == “on”) ON else OFF)
end


rule "FrontDoor reset"
when
    Item FrontDoorOutValue received command
then
    FrontDoorSafety.sendCommand(OFF)
end

thanks for your reply. works fine! No question, but structured behind icons. The only thing is that I can’t see the actual status immediately. but it’s ok.