i3detroit / homeassistant-config

home assistant configuration files
https://www.i3detroit.org/wiki/Category:IoT
1 stars 1 forks source link

amazon dash buttons post repeatedly #10

Closed abzman closed 6 years ago

abzman commented 6 years ago

each button should have an individual cooldown so it doesn't post more than once per minute, but collectively the buttons should be able to post many times a minute

mkfink commented 6 years ago

This will require us to switch to https://github.com/maddox/dasher for dash button handling. Probably what we should have been using all along but I didn't find it first.

mkfink commented 6 years ago

To convert dash.io options.json to dasher config.json for use in home assistant: find

\s\s{\s\s\s\s\s"name": "(.+)",[.\n\s]+"address":\s"([\d:a-f]+)",\n[\n\s"a-z:,{\]+script.([a-z\d]+)\"}"\n\s\s}
replace (mind the leading whitespace)

  {
    "name": "\1",
    "address": "\2",
    "timeout": "60000",
    "protocol": "udp",
    "method": "POST",
    "url": "http://10.13.0.22:8123/api/services/script/turn_on",
    "json": true,
    "body": {"entity_id": "script.\3"}
  }
mkfink commented 6 years ago

https://github.com/i3detroit/homeassistant-config/commit/3c25a95cbef06a42cf8d124fc2f4224c8193bcac

Done