# how to PUSH BUTTON SYNC with webthing.io

**URL:** <https://discourse.mozilla.org/t/how-to-push-button-sync-with-webthing-io/81773>\
**Category:** WebThings\
**Tags:** learning\
**Created:** [June 16, 2021, 12:22pm UTC](https://discourse.mozilla.org/t/how-to-push-button-sync-with-webthing-io/81773 "2021-06-16T12:22:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![levananhlhu](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/levananhlhu/32/49344_2.png) [@levananhlhu](https://discourse.mozilla.org/u/levananhlhu)\
**Post date:** [June 16, 2021, 12:22pm UTC](https://discourse.mozilla.org/t/how-to-push-button-sync-with-webthing-io/81773/1 "2021-06-16T12:22:41Z")

</div>

Hello everyone, I’m a newbie to [webthing.io](http://webthing.io)  
I’m still interested in the button sync with LEDs on webthing. I came across the webthing-arduino library at this link ([https://github.com/WebThingsIO/webthing-arduino/tree/master/](https://github.com/WebThingsIO/webthing-arduino/tree/master/) examples), but it doesn’t mention what I’m looking for.  
i would love to have an example part with results like this video ([https://www.youtube.com/watch?v=ePW3nJNGt9M&list=LL&index=1](https://www.youtube.com/watch?v=ePW3nJNGt9M&list=LL&index=1))  
I really hope someone reads it and can help me, thank you

---

<div class="post-metadata">

**Author:** ![EricEdberg](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/ericedberg/32/29005_2.png) [@EricEdberg](https://discourse.mozilla.org/u/EricEdberg)\
**Post date:** [June 16, 2021, 5:17pm UTC](https://discourse.mozilla.org/t/how-to-push-button-sync-with-webthing-io/81773/2 "2021-06-16T17:17:10Z")

</div>

WebThings includes an API allowing remote applications to use HTTP calls to change thing “parameters”, such as a virtual device’s “push button” property. I wrote a monitor bash script that parses a logfile, and when necessary, execute an http put request to WT. You must generate a static API KEY and include this as the authorization in a put request. In my case, I used the Virtual Things add-on, and created a push button thing. Suprisingly, it’s been working great for me.

I started learning the API using this example:

> <https://github.com/WebThingsIO/curl-examples/blob/master/README.md>

Here is a link to anohter thread I posted to:

> [@Implement IR remote thing](https://discourse.mozilla.org/t/implement-ir-remote-thing/78516/2):
>
> I used a Virtual Device addon “Push Button” instance and a custom rule to fire events when the button was pushed. Create a custom rule: Condition: When “named button” is pushed OR [insert other conditions to trigger event] Action: Perform real action AND reset “named button” to NOT pushed Basically when the button is pushed an action is triggered. You must reset the button to not-pushed as one of the actions.

Here is a link to the GitHub repository I wrote that tails the X10 Mochad logfile which I translate to WebThing property changes:

> **[GitHub - EricLEdberg/X10-MOCHAD-TRIGGER: Monitor X10 CM15/19 Mochad process & trigger...](https://github.com/EricLEdberg/X10-MOCHAD-TRIGGER)**
>
> Monitor X10 CM15/19 Mochad process & trigger remote WebThings API

I could probably dig up or create some notes on how to create a Virtual Thing “button” as it’s not straight forward…

---

<div class="post-metadata">

**Author:** ![levananhlhu](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/levananhlhu/32/49344_2.png) [@levananhlhu](https://discourse.mozilla.org/u/levananhlhu)\
**Post date:** [June 16, 2021, 5:46pm UTC](https://discourse.mozilla.org/t/how-to-push-button-sync-with-webthing-io/81773/3 "2021-06-16T17:46:50Z")

</div>

Can you guide me step by step. please

---

<div class="post-metadata">

**Author:** ![levananhlhu](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/levananhlhu/32/49344_2.png) [@levananhlhu](https://discourse.mozilla.org/u/levananhlhu)\
**Post date:** [June 20, 2021, 1:03pm UTC](https://discourse.mozilla.org/t/how-to-push-button-sync-with-webthing-io/81773/4 "2021-06-20T13:03:24Z")

</div>

I use esp8266 to control the device and I want to synchronize the physical buttons with the website
