
Show HN: Send a slack msg with AWS IoT button - katsuyan
https://github.com/kn/iotslackbutton/blob/master/README.md
======
do5
I'm using an IoT button as an Amazon Now Dash Button. With the Dash button,
I've realized there's more times I need my Tide detergent or a pack of condoms
sooner than later and luckily I'm a programmer so the IoT button made this
possible it's been quite handy.

~~~
colinbartlett
Is the code for that open sourced? Perhaps my biggest frustration with Dash
buttons was that they were only for specific products from specific brands and
it would be great to hook an IoT button to ANY product of my choosing.

~~~
theOnliest
You could use
[https://metacpan.org/pod/Amazon::Dash::Button](https://metacpan.org/pod/Amazon::Dash::Button),
and write your own handler in Perl using an ordinary Dash button.

~~~
Rjevski
But why would you ever use such an awkward language to do this task?

~~~
tyingq
Perl is actually not a bad choice for matching a Mac address, and invoking
some external event. Why would it be awkward?

~~~
Rjevski
Well it's more about the language being needlessly complicated and having 10x
different ways to do the same thing, not to mention the language (Perl 5 that
is - 6 is a different story) lacks essential concepts like object orientation
and exceptions (you have to get "shims" like Moose or Try::Tiny from CPAN to
fill those gaps). Why would you choose something like this instead of Python
or Ruby?

~~~
tyingq
>lacks essential concepts like object orientation and exceptions

Perl does OO without Moose. There is a tiny bit of boilerplate, but it's
essentially bless() and 1 or 2 lines in the constructor.

Try/catch blocks are indeed an add on. The traditional pattern is more golang
like, returning an error code, then using Carp or similar for stack traces.

>Why would you choose something like this instead of Python or Ruby?

That might be an interesting discussion for a large codebase, but for
something limited in scope like this, I just don't see the problem.

------
egeozcan
Does anyone know of a similar product with replaceable battery that's not
bound to a 3rd party?

I can come up with something myself using an Arduino and an arcade-button but
I know me. I will never get around to doing it and it will never look as
slick.

~~~
tyingq
$12.37 shipped to the US for an ESP8266 with AA battery holder and button
style case. Not much feedback though, and the words in the url don't match the
product...so it's a bit of a dice roll.

[https://www.aliexpress.com/item/30-energy-saving-
CC2541-ibea...](https://www.aliexpress.com/item/30-energy-saving-
CC2541-ibeacon-module-Bluetooth-4-0-module-BLE-ibeacon-for-indoor-
navigation/32753259856.html)

~~~
mikegreen
The quality and consistency of firmware/functionality/hidden stuff on the
various 8266's I have leads me to avoid them. I had a pair that phoned home to
some Chinese domain and registered all via HTTP, and a quick Wireshark yielded
it phoned home for commands. Not on my network... You can pick them up cheaper
on ebay, as well.

~~~
tyingq
Hmm. Something that survives a firmware overwrite?

~~~
mikegreen
It depends :-) Some seem to have a fall-back or fail-safe that isn't
overwritten. Even with flashing known firmware, the reliability of the little
guys was questionable. Random lockups and very touchy to power source.

