# StreamDeck Toggle Button update state via script

**URL:** <https://community.folivora.ai/t/streamdeck-toggle-button-update-state-via-script/31251>\
**Category:** Configuration Help & General Discussion\
**Tags:** stream-deck\
**Created:** [April 14, 2023, 10:38pm UTC](https://community.folivora.ai/t/streamdeck-toggle-button-update-state-via-script/31251 "2023-04-14T22:38:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nextthursday](https://community.folivora.ai/user_avatar/community.folivora.ai/nextthursday/32/25629_2.png) [@nextthursday](https://community.folivora.ai/u/nextthursday)\
**Post date:** [April 14, 2023, 10:38pm UTC](https://community.folivora.ai/t/streamdeck-toggle-button-update-state-via-script/31251/1 "2023-04-14T22:38:31Z")

</div>

I'm still trying to grasp all the unlimited possibilities and search around discussions and docs, so perhaps this is easy:

I want to use a StreamDeck Toggle On/Off Button to switch a HomeKit Scene, that works wonderful and easy e.g. via a Apple Shortcut.

However I want the state of the toggle button to be updated depending on the scene state.

What I tried so far:  
**Trigger Link**  
Copying the "Toggle On Action Sequence" trigger link runs the actions, but won't switch the state.  
Copying the "Toggle On / Off Button" trigger link is like a button press, thus I can't set the state, but only toggle it.

**Apple Script Widget with update\_stream\_deck\_widget** :  
I know the right approach could e.g. be a Apple Script Widget and I know that I can

```auto
tell application "BetterTouchTool"
	update_stream_deck_widget "<uuid>" <stuff>

```

However I don't know how to figure out what would toggle the UUID toggle button state.

Any suggestions?
