Multiple dash presses registered even with timeout enabled.
I'm seeing an issue with the dash button being registered multiple times even though a timeout has been set. Same result with different protocols.
Configuration:
{"buttons":[
{
"name": "Lamp Desk Light 1 - GLAD",
"address": "redacted",
"url": "http://localhost:8123/api/services/switch/toggle",
"method": "POST",
"protocol": "udp",
"timeout": "30000",
"headers": {"x-ha-access":redacted ""},
"json": true,
"body": {"entity_id": "switch.wemo_switch"}
},
{
"name": "Lamp Desk Light 2 - Tide",
"address": "redacted",
"url": "http://localhost:8123/api/services/switch/toggle",
"method": "POST",
"protocol": "udp",
"timeout": "30000",
"headers": {"x-ha-access":redacted ""},
"json": true,
"body": {"entity_id": "switch.wemo_switch"}
}
]}
Resulting logs where it flickers. It seems to not implement the timeout if registered multiple times in the same millisecond?
Jul 17 16:52:24 HomeAssistant npm[10943]: [2017-07-17T23:52:24.161Z] Lamp Desk Light 2 - Tide pressed. Count: 13 Jul 17 16:52:24 HomeAssistant npm[10695]: [2017-07-17T23:52:24.162Z] Lamp Desk Light 2 - Tide pressed. Count: 15 Jul 17 16:52:24 HomeAssistant npm[10744]: [2017-07-17T23:52:24.162Z] Lamp Desk Light 2 - Tide pressed. Count: 14 Jul 17 16:52:24 HomeAssistant npm[10973]: [2017-07-17T23:52:24.163Z] Lamp Desk Light 2 - Tide pressed. Count: 12
Just wanted to chime in and say I'm having the same issue. Seems to be registering the push a second time after about ~30 - 45 seconds. have you tried setting the timeout lower? I'll try when I get home and report back
Actually sorry, set the timeout higher. I set it to 60,000 and it's working fine now. You obviously have to wait to press again but it's a work around for now
Good to know, I'll try it for a week or so and report back results.
Bah, that was short lived. It looks like I'm still having the problem. I made sure to restart the service and verify changes too.
I have the buttons being blocked by firewall, but that shouldn't affect the results since the timeout is supposed to ignore all calls after the first for the set period of time.
Too bad I don't know how to code in this language to fix it.
I had the same issue. I set the timeout to 10000 and that did not help. I then restarted the entire pi and that fixed the issue.
Has anyone figured this out by chance? I am having the same issue. My dash button is being registered at random lengths of time as soon as I start running dasher even without pressing the button at all. I've tried restarting my pi and that didn't seem to fix it.
This is after I started the program and never pressed the button. And it keeps going.
pi@jared:~/dasher $ sudo npm run start
[email protected] start /home/pi/dasher node app.js
[2018-01-13T23:44:00.509Z] amzbasicsbatteries added. [2018-01-13T23:48:05.904Z] amzbasicsbatteries pressed. Count: 1 [2018-01-13T23:49:46.783Z] amzbasicsbatteries pressed. Count: 2 [2018-01-13T23:50:35.663Z] amzbasicsbatteries pressed. Count: 3 [2018-01-13T23:51:22.463Z] amzbasicsbatteries pressed. Count: 4
{"buttons":[ { "name": "amzbasicsbatteries", "address": "Mac Address", "timeout": "20000", "interface": "eth0", "url": "https://maker.ifttt.com/trigger/goodnight/with/key/IFTTT "method": "POST" } ]}
Unfortunately, I'm still having the issue as well, although I'm using a VM.
Also, it doesn't seem like the developer is even active anymore.
I figured out the issue I was having. Maybe it's the same for you.
My issue was that I was actually using the wrong MAC Address. I downloaded wireshark and found that there was a UDP signal that keeps repeating on it's own and the source is called Sagemcom. That is the MAC address I had gotten when I ran sudo ./script/find_button. If you go into wireshark and press the dash button you get a, AmazonTe ARP trigger. When you click on that it gives you the correct MAC Address to use. That trigger only shows up one time in wireshark every time I press the dash button.
Hope this helps.
@jared591 I wish it were the case, but I found my button MAC through my router and verified it against the MAC vendor list.
I also had put the Dasher instance, Home assistant, and Dash button on their own test network so nothing else could interfere.
I see a pull request that uses Docker so I may go that route so that all resources are the proper versions and see if it somehow fixes my issue.
+1 Seeing same issue. One dash press triggering multiple activations. The following is the log result from a single dash press:
Feb 14 22:54:59 philotic npm[21458]: [2018-02-15T03:54:59.799Z] Dream Water pressed. Count: 2 Feb 14 22:54:59 philotic npm[27545]: [2018-02-15T03:54:59.823Z] Dream Water pressed. Count: 1 Feb 14 22:54:59 philotic npm[27728]: [2018-02-15T03:54:59.887Z] Dream Water pressed. Count: 1 Feb 14 22:55:00 philotic npm[22415]: [2018-02-15T03:55:00.579Z] Dream Water pressed. Count: 2
Here is the config for that button:
{
"name": "Dream Water",
"address": "ac:63:be:84:80:4f",
"timeout": "60000",
"protocol": "arp",
"url": "http://localhost:8123/api/services/script/turn_on",
"method": "POST",
"headers": {"x-ha-access": "
Have tried with protocol udp and arp.
Anyone have a fix? This all works great at a different location running on Raspbian on a Pi3. Having this issue under Ubuntu 16.04.
Are you using systemd to autostart Dasher?
I had this trouble because whenever I restarted Dasher with "sudo systemctl restart dasher," I would wind up with two instances of Dasher running. It looks like you're in the same boat.
The instructions I used had me set up my systemd file like this:
[Unit]
Description=Dasher
After=network.target
[Service]
Type=simple
#user with access to dasher files
User=root
WorkingDirectory=/home/pi/dasher
#use command "which npm" to determine correct location of NPM
ExecStart=/usr/local/bin/npm run start
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
I removed these lines, then rebooted. It worked fine after.
Restart=on-failure
RestartSec=10
KillMode=process
Wow. Worked perfectly after edit. Thanks.
On Sun, Jul 22, 2018 at 9:27 PM chris87p [email protected] wrote:
Are you using systemd to autostart Dasher?
I had this trouble because whenever I restarted Dasher with "sudo systemctl restart dasher," I would wind up with two instances of Dasher running. It looks like you're in the same boat.
The instructions I used https://github.com/maddox/dasher/wiki/Running-Dasher-on-a-Raspberry-Pi-at-startup had me set up my systemd file like this:
[Unit] Description=Dasher After=network.target
[Service] Type=simple #user with access to dasher files User=root WorkingDirectory=/home/pi/dasher #use command "which npm" to determine correct location of NPM ExecStart=/usr/local/bin/npm run start Restart=on-failure RestartSec=10 KillMode=process
[Install] WantedBy=multi-user.target
I removed these lines, then rebooted. It worked fine after.
Restart=on-failure RestartSec=10 KillMode=process
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maddox/dasher/issues/87#issuecomment-406914063, or mute the thread https://github.com/notifications/unsubscribe-auth/AFh0TKMKdwTFO-aHZrSbC3-Awl2F9X3bks5uJSZlgaJpZM4Oar44 .