Can you write a value to a variable that lives in a device?

I want to store a value in a variable that lives in a device when I click a button. Is this possible and how?

Thanks

Yes, this is possible. When you configure your Button’s DataAction, simply click the ... button in the Value box, the choose your source device variable.

Awesome. Thanks! I’m trying to see if I can create a multi-mode button (for HVAC), which includes Heat, Cool, Auto, and a separate on/off button. The idea I had was to store the current HVAC mode (if button is on) to a variable that would be used to restore the HVAC mode if the on/off button was turned on again).