Post 9p7xffYCtDf4bChVDM by sheogorath@microblog.shivering-isles.com
 (DIR) More posts by sheogorath@microblog.shivering-isles.com
 (DIR) Post #9p7w92womOHNeY5oX2 by codesections@fosstodon.org
       2019-11-19T17:44:02Z
       
       0 likes, 0 repeats
       
       #HomeAutomation question:I would like to have a (physical) button that I can press to trigger an http request/hit an API endpoint.  What's the best way to do that?I seems like something that I could do with an #arduino, but that might be overkill?I don't know much about home automation/this level of tech, so I'd appreciate any clues :D
       
 (DIR) Post #9p7wKQPZsjBPbtyEjo by penguin42@mastodon.org.uk
       2019-11-19T17:46:11Z
       
       0 likes, 0 repeats
       
       @codesections Well; where is this button going to live? Is it connected to another computer? How is it powered? How is it going to communicate with whatever web server?  Is this really one button or a dozen similar buttons?
       
 (DIR) Post #9p7wRSCtbY6PCpOGVE by wizzwizz4@fosstodon.org
       2019-11-19T17:47:20Z
       
       0 likes, 0 repeats
       
       @codesections  1. Find the cheapest battery-powered Bluetooth device you can (that's not made in one of the rights-violating regions, of course). 2. Get a Raspberry Pi Zero-W. 3. Pair them. 4. Use cheap Bluetooth device as a button! YAY! 5. Get another cheap device when you want another button.If you only want one button ever, then you can just use one Pi Zero-W, but like the Arduino idea that seems overkill.
       
 (DIR) Post #9p7xLgkQjGFMWJtGka by codesections@fosstodon.org
       2019-11-19T17:57:32Z
       
       0 likes, 0 repeats
       
       @wizzwizz4That makes sense, thanks!For step 1, do you have any recommendations/pointers for finding a battery powered Bluetooth button?  A quick Internet search led me to https://flic.io/ — is that similar to what you mean?
       
 (DIR) Post #9p7xWO6KOihpsEEcQi by wizzwizz4@fosstodon.org
       2019-11-19T17:59:26Z
       
       0 likes, 0 repeats
       
       @codesections That's a lot better than I was talking about. I meant stuff like second-hand broken headphones that still have a pause button, and stuff like that.
       
 (DIR) Post #9p7xffYCtDf4bChVDM by sheogorath@microblog.shivering-isles.com
       2019-11-19T18:01:02Z
       
       0 likes, 0 repeats
       
       @codesections Maybe this is helpful?https://scotthelme.co.uk/lets-encrypt-is-only-a-click-away/
       
 (DIR) Post #9p7xqII1iJHjdrCNzE by aeveltstra@mastodon.social
       2019-11-19T18:03:00Z
       
       0 likes, 0 repeats
       
       @codesections You can send HTTP-based REST API requests using an app named Postman. You can automate that to test the response and then perform other actions you might need. The physical button then could be a mouse button.   Several years ago a product was available for Mac computers that was called "The Button". It could be tapped, dialed, and nudged. Something like that might suit your needs.
       
 (DIR) Post #9p7zHAcQRTY1cj7TlI by Zelmor@fosstodon.org
       2019-11-19T18:18:50Z
       
       0 likes, 0 repeats
       
       @codesectionsGet a big red usb connected button and write it up in bash, python, whatever.
       
 (DIR) Post #9p80NkVM22M6c6Vs48 by codesections@fosstodon.org
       2019-11-19T18:31:35Z
       
       0 likes, 0 repeats
       
       @penguin42 All really good questions!  Here are some answers:Q: where is this button going to live? A: Probably wall-mounted or on a table.Q: Is it connected to another computer?A: Not physicallyQ: How is it powered? A: BatteryQ: How is it going to communicate with whatever web server?A: However.  Bluetooth to a home server probably makes the most sense?  Q: Is this really one button or a dozen similar buttons?A: ~1–6+ similar buttons depending on cost/button
       
 (DIR) Post #9p80lHgoojRECA67zk by codesections@fosstodon.org
       2019-11-19T18:35:43Z
       
       0 likes, 0 repeats
       
       Thanks for all the #homeAutomation tips for creating a physical button!Based on all the words of wisdom I've received, I'll probably follow an approach something like this article: $2 Bluetooth Tags and Tangible UIs for IoT, https://medium.com/@monkeytypewritr/2-bluetooth-tags-and-tangible-uis-for-iot-47599869a7fbThe cheapo button they used isn't for sale anymore, but this one looks broadly similar, for about the same $2 price: https://www.aliexpress.com/item/32722960973.html
       
 (DIR) Post #9p80oWs6pKts9NvU00 by penguin42@mastodon.org.uk
       2019-11-19T18:36:26Z
       
       0 likes, 0 repeats
       
       @codesections So I think you can get bluetooth low energy buttons already - but I don't know enough about bluetooth
       
 (DIR) Post #9p80tMZMYg9xe7SkQi by codesections@fosstodon.org
       2019-11-19T18:37:10Z
       
       0 likes, 0 repeats
       
       @sheogorath That is helpful.  It doesn't *quite* work any more since it relies on the now-discontinued Amazon Dash buttons.But the general idea of a BLE button seems like the way to go
       
 (DIR) Post #9p81EDXdJq3PjBb7kO by codesections@fosstodon.org
       2019-11-19T18:41:02Z
       
       0 likes, 0 repeats
       
       @aeveltstra > You can send HTTP-based REST API requests using an app named Postman. Yeah, or curl or python's request or Rust's reqwest… once I get an event triggered on a PC, there are lots of ways to send the request. >The physical button then could be a mouse button.But that's exactly what I'm trying to avoid—needing to open/log in/interact with a computer.  (I may spend *most* of my time in front of a screen, but not *all* of it :D )
       
 (DIR) Post #9p81XqfA5gCEYxTowa by mdhughes@cybre.space
       2019-11-19T18:44:30Z
       
       0 likes, 0 repeats
       
       @codesections Get a little embedded computer like a Pi or Arduino, hook up a button to a couple input pins, write the tiniest program to poll the pins, system("curl ...") when true. Easy even if you don't do much electronics, you can wire-wrap wires to a button.
       
 (DIR) Post #9p82MajX4kzTvXijWy by codesections@fosstodon.org
       2019-11-19T18:53:44Z
       
       0 likes, 0 repeats
       
       @mdhughes >  Get a little embedded computer like a Pi or Arduino, hook up a button to a couple input pins, write the tiniest program to poll the pins, system("curl ...") when true. Easy Makes sense.  The part I'm getting stuck on is the "hook up a button to a couple input pins"—all my pi projects so far have been purely software.Are you talking about something like this:https://www.electronicshub.org/raspberry-pi-push-button-interface/I might still go with the bluetooth-low-energy dongle + Pi 0w to avoid extra wires, though… hmm
       
 (DIR) Post #9p835m9xRLQwOcct60 by mdhughes@cybre.space
       2019-11-19T19:01:48Z
       
       0 likes, 0 repeats
       
       @codesections Exactly that. It's so easy even someone with no electronics practice can do it. Stick a wire in the correctly numbered pin.