I solved with this script

- Cattura.PNG (25.57 KiB) Viewed 688 times
and this rule in tasmota
rule1 on Button1#state=2 do backlog publish domoticz/in {"command":"setuservariable","idx":4,"value":"2"}; POWER TOGGLE ENDON
where idx 4 is ID of variable stato_cappa