I’m using dasher: https://github.com/maddox/dasher
Since I am using docker containers, I run dasher in a container using this: https://github.com/clemenstyp/dasher-docker
Dasher calls the HA API.
E.g this is from the readme config:
{
"name": "Party Time",
"address": "d8:02:dc:98:63:49",
"url": "http://192.168.1.55:8123/api/services/scene/turn_on",
"method": "POST",
"headers": {"authorization": "your_password"},
"json": true,
"body": {"entity_id": "scene.party_time"}
},
This is my dasher config:
{"buttons":[
{
"name": "Lounge Lights",
"address": "mac address of button 1",
"interface": "ens160",
"url": "http://ubuntudocker:8123/api/services/light/toggle",
"method": "POST",
"headers": {"x-ha-access": "mypassword"},
"json": true,
"body": {"entity_id": "light.living_room"}
},
{
"name": "Downstairs Lights",
"address": "mac address of button 2",
"interface": "ens160",
"url": "http://ubuntudocker:8123/api/services/light/turn_off",
"method": "POST",
"headers": {"x-ha-access": "mypassword"},
"json": true,
"body": {"entity_id": "group.downstairs_switches"}
},
{
"name": "Downstairs Switches",
"address": "mac address of button 3",
"interface": "ens160",
"url": "http://ubuntudocker:8123/api/services/switch/turn_off",
"method": "POST",
"headers": {"x-ha-access": "mypassword"},
"json": true,
"body": {"entity_id": "group.downstairs_switches"}
}
]}
Whilst I have left the dash buttons I configured in place, I am using xiaomi buttons elusively going forward due to:
- they respond immediately
- they are natively supported in HA (no need to configure API calls)
- they have multiple events (click, double click etc)