Toggling Button State

have a look at this post How to toggle light on and off , between Cayenne app and momentary switch, for home automation? - #10 by steaveultimate