{"id":28517280,"url":"https://github.com/dfranzen/simple-universal-touchpad-for-homeassistant","last_synced_at":"2026-04-25T11:33:41.744Z","repository":{"id":294512891,"uuid":"987191427","full_name":"DFranzen/Simple-Universal-Touchpad-for-Homeassistant","owner":"DFranzen","description":"A simple universal touchpad which can trigger arbitrary automation","archived":false,"fork":false,"pushed_at":"2025-06-02T18:43:06.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T05:01:56.913Z","etag":null,"topics":["homeassistant","input","lovelace-custom-card","lovelace-ui","touchpad"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DFranzen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-20T17:55:58.000Z","updated_at":"2025-06-02T18:43:10.000Z","dependencies_parsed_at":"2025-05-20T20:30:43.675Z","dependency_job_id":"54574fc1-3714-4035-b95b-4d8c89fba2f7","html_url":"https://github.com/DFranzen/Simple-Universal-Touchpad-for-Homeassistant","commit_stats":null,"previous_names":["dfranzen/simple-universal-touchpad-for-homeassistant"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DFranzen/Simple-Universal-Touchpad-for-Homeassistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFranzen%2FSimple-Universal-Touchpad-for-Homeassistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFranzen%2FSimple-Universal-Touchpad-for-Homeassistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFranzen%2FSimple-Universal-Touchpad-for-Homeassistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFranzen%2FSimple-Universal-Touchpad-for-Homeassistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DFranzen","download_url":"https://codeload.github.com/DFranzen/Simple-Universal-Touchpad-for-Homeassistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFranzen%2FSimple-Universal-Touchpad-for-Homeassistant/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263832100,"owners_count":23517344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["homeassistant","input","lovelace-custom-card","lovelace-ui","touchpad"],"created_at":"2025-06-09T05:01:09.501Z","updated_at":"2026-04-25T11:33:41.689Z","avatar_url":"https://github.com/DFranzen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Universal Touchpad for Homeassistant / Lovelace\nThis card displays a simple universal touchpad which writes its events into helper variables. This way the events can be acted upon with any automation.\n(Inspired and initially based on code from https://github.com/iablon/HomeAssistant-Touchpad-Card)\n\n## Sample view\n### Card\n![card](https://github.com/user-attachments/assets/793eecfe-1c6e-4898-ab20-1a30e0743871)\n### Configuration\n![edit](https://github.com/user-attachments/assets/3448b2f4-05cd-4bc6-9193-026b2cd87886)\n\n## Features\n- Simple to use card\n- Simulating a touchpad input area with two buttons, similar to the trackpad of a laptop.\n- Flexible mapping of the input to homeassistant actors trough full feature set of automations\n\n## Generated Events\nThe card generates three kinds of events:\n\n- Mouse move events: Every time the user moves the finger on the touchpad, the distance travelled in the two axes (x and y) is measured\n\n- Mouse Click events: The card simulates a mouse with two buttons: left and right.The emulated mouse buttons can be in a pressed or released state. The pressed state of each of the two buttons is represented as a boolean. If the user taps (touch and release imidiately) the touchpad area or the buttons on the bottom of the card the corresponding button is pressed and released imidiately, resulting in a mouse button click.\nIf the user holds the finger down without mocing (longpress) on the buttons or the touchpad area, the card initialtes a hold, keeping the button state pressed, even if the finger or mouse is subsequently removed from the touchpad. This way the user can drag items with the simulated mouse. The holding can only be released by a simple tap.\n\n- Cursor events: In addition to the mouse movement, the card also generates Cursor events, every time the user lifts the finger from the touchpad area. For example, when the final position of the finger is mostly to the right of the initial touch-down position, a curser-right event. The same holds for all for major directions left/right/up/down. This event can be used with devices, which do not have a mouse pointer, but directional input buttons, like TVs.\n\n# Setup\n\n## Installation\n- In HomeAssistant navigate to HACS and open the overflow menu (three dots at the top)\n- Select \"Custom Repositories\" and enter the following into the pop-up:\n  - Repository: https://github.com/DFranzen/Simple-Universal-Touchpad-for-Homeassistant/\n  - Type: Dashboard\n- Click Add\n- In HACS click on tree dots in the row for \"Simple Universal Touchpad\"\n- Select \"Download\" and confirm with \"Download\"\n- After the download is finished, confirm \"Reload\" in the pop-up\n\n## Preperation\nThe Touchpad card interfaces with HomeAssistant through helpers.\nTo Prepare for the configuration you need to create a few new helpers, which the card can use to store the events.\n\nOpen the \"Helpers\" Tab under \"Settings\" -\u003e \"Devices \u0026 Services\" and create the required helpers. You only need to create the helpers for the event you want to use.\n- For the mouse movement events, create two input_numbers for the mouse movements (x/y), suggested names: Mouse_x, Mouse_y\n- For the mouse button events, create two input_boolean for the mouse buttons (left/right), suggested names: Mouse_ButtonLeft, Mouse_ButtonRight\n- For the cursor move events, create four input_boolean, one for each direction (left/right/up/down), suggested names: Mouse_CursorLeft, Mouse_CursorRight, Mouse_CursorUp, Mouse_CursorDown, \n\n## Configuration\nAdd the touchpad card to the dashboard and open the configuration dialog. Here you can enable the desired events, which should be fired, and assign the newly created helpers to the corresponding fields.\n\n## Usage\nOnce the card is interacted with it writes the event's data into the given helpers. The input_boolen helpers are set to true, when the mouse button is pressed and the input_numbers helpers contain the last distance travelled in x/y direction.\n\nIn order to link the events written to the helpers with actors automations can be used. These could do any action in HomeAssistant. The automations should have the following properties\n- The trigger is\n```\nentity_id:\n  - input_number.mouse_y\ntrigger: state\n```\n\n- One of the actions under \"Then do\" should reset the helper to 0 or false:\n```\ndata:\n  value: 0\ntarget:\n  entity_id: input_number.mouse_y\naction: input_number.set_value\n```\n\n# Example Usage\n## ssh - xdotool\nOne of the easiest way to relay the inputs to the mouse-pointer of a computer is ssh under kde with xdotool\n\n### Reqiurements\n- The Computer should be running linux with x11-server as the window manager\n- The HomeAssistant server needs ssh-access to the target computer.\n  - Grant authorisation, either\n    - set up password-less login from the HomeAssistant device\n    - (not recommended) use sshpass infront of all ssh commands\n  - Make ssh sessions permanent (Otherwise HomeAssistant needs to authenticate for every mouse movement, resulting in delays):\n  Add the following to .ssh/config on the HomeAssistant device\n  ```\n     Host *\n          ControlMaster auto\n     \t  ControlPath /tmp/ssh-%r@%h:%p\n     \t  ControlPersist yes\n  ```\n- \n\n### Preparation\nAdd the following shell_commands to the configuration.yaml. Substitude \"user\" and \"targetip\" with the appropriate values and modify mouse_x/mouse_y with the names you assigned to the helper variables.\n```\nshell_command:\n  computer_mousemove:  ssh user@targetip 'export DISPLAY=:0;xdotool mousemove_relative -- {{ ((states.input_number.mouse_x.state | float *-10 ) ) | string }} {{ ((states.input_number.mouse_y.state | float *-10 ) ) | string }}'  \n  computer_mouse_leftdown:  ssh user@targetip 'export DISPLAY=:0;xdotool mousedown --clearmodifiers 1'\n  computer_mouse_leftup:    ssh user@targetip 'export DISPLAY=:0;xdotool mouseup   --clearmodifiers 1'\n  computer_mouse_rightdown: ssh user@targetip 'export DISPLAY=:0;xdotool mousedown --clearmodifiers 3'\n  computer_mouse_rightup:   ssh user@targetip 'export DISPLAY=:0;xdotool mouseup   --clearmodifiers 3'  \n```\n\n### Automation\nMouse move:\n```\nalias: MouseMove_to_Laptop\ndescription: \"\"\ntriggers:\n  - entity_id:\n      - input_number.mouse_y\n    trigger: state\nactions:\n  - action: shell_command.computer_mousemove\n    data: {}\n  - data:\n      value: 0\n    target:\n      entity_id: input_number.mouse_y\n    action: input_number.set_value\n  - data:\n      value: 0\n    target:\n      entity_id: input_number.mouse_x\n    action: input_number.set_value\nmode: single\n```\n\nMouse Down/up (Example for Left Down, adjust for right and up)\n```\nalias: MouseLeftDown_to_Laptop\ndescription: \"\"\ntriggers:\n  - entity_id:\n      - input_boolean.mouse_buttonleft\n    to: \"on\"\n    trigger: state\nactions:\n  - action: shell_command.computer_mouse_leftdown\n    data: {}\nmode: single\n```\n\n## MQTT / Node-red\n\n### Requirements\n- Node-red setup on the target computer\n- Target computer reachable through node-red from the HomeAssistant\n\n### Setup on Node-red\n#### Mousemove flow\n\u003cdetails\u003e\n\n\u003csummary\u003eExample Node-Red configuration\u003c/summary\u003e\nReplace all the \u003cMQTTBroker...\u003e information with your own\n\n```\n[\n    {\n        \"id\": \"3a04694b8d100522\",\n        \"type\": \"mqtt in\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"\",\n        \"topic\": \"input_pair/Laptop_Mouse/set\",\n        \"qos\": \"2\",\n        \"datatype\": \"auto-detect\",\n        \"broker\": \"7715a72184178191\",\n        \"nl\": false,\n        \"rap\": true,\n        \"rh\": 0,\n        \"inputs\": 0,\n        \"x\": 280,\n        \"y\": 1060,\n        \"wires\": [\n            [\n                \"524a96c3928b323b\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"524a96c3928b323b\",\n        \"type\": \"function\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"extract coordinates\",\n        \"func\": \"var factor=10\\nif (Number.isInteger(msg.payload.x) \u0026\u0026 Number.isInteger(msg.payload.y))\\n  factor = 1\\nreturn {payload: \\\"\\\" + Math.round(-msg.payload.x*factor) + \\\" \\\" + Math.round(-msg.payload.y*factor)};\",\n        \"outputs\": 1,\n        \"noerr\": 0,\n        \"initialize\": \"\",\n        \"finalize\": \"\",\n        \"libs\": [],\n        \"x\": 570,\n        \"y\": 1060,\n        \"wires\": [\n            [\n                \"01badf34c2ebf7ec\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"01badf34c2ebf7ec\",\n        \"type\": \"exec\",\n        \"z\": \"9072b355de756fe9\",\n        \"command\": \"export DISPLAY=:0;xdotool mousemove_relative -- \",\n        \"addpay\": \"payload\",\n        \"append\": \"\",\n        \"useSpawn\": \"false\",\n        \"timer\": \"\",\n        \"winHide\": false,\n        \"oldrc\": false,\n        \"name\": \"\",\n        \"x\": 1050,\n        \"y\": 1060,\n        \"wires\": [\n            [],\n            [],\n            []\n        ]\n    },\n    {\n        \"id\": \"7715a72184178191\",\n        \"type\": \"mqtt-broker\",\n        \"name\": \"\u003cMQTTBrokerName\u003e\",\n        \"broker\": \"\u003cMQTTBrokerIP\u003e\",\n        \"port\": \"\u003cMQTTPort\u003e\",\n        \"tls\": \"\u003cMQTTBrokerTLS\u003e\",\n        \"clientid\": \"\u003cMQTTBrokerID\u003e\",\n        \"autoConnect\": true,\n        \"usetls\": true,\n        \"protocolVersion\": \"4\",\n        \"keepalive\": \"60\",\n        \"cleansession\": false,\n        \"birthTopic\": \"\",\n        \"birthQos\": \"0\",\n        \"birthPayload\": \"\",\n        \"birthMsg\": {},\n        \"closeTopic\": \"\",\n        \"closeQos\": \"0\",\n        \"closePayload\": \"\",\n        \"closeMsg\": {},\n        \"willTopic\": \"\",\n        \"willQos\": \"0\",\n        \"willPayload\": \"\",\n        \"willMsg\": {},\n        \"userProps\": \"\",\n        \"sessionExpiry\": \"\"\n    },\n    {\n        \"id\": \"\u003cMQTTBrokerTLS\u003e\",\n        \"type\": \"tls-config\",\n        \"name\": \"\",\n        \"cert\": \"\",\n        \"key\": \"\",\n        \"ca\": \"\",\n        \"certname\": \"\",\n        \"keyname\": \"\",\n        \"caname\": \"ca.crt\",\n        \"servername\": \"\",\n        \"verifyservercert\": false,\n        \"alpnprotocol\": \"\"\n    }\n]\n```\n\u003c/details\u003e\n\n#### Mouse Buttons\n\n\u003cdetails\u003e\n\n\u003csummary\u003eExample Node-Red configuration\u003c/summary\u003e\n\nReplace all the \u003cMQTTBroker...\u003e information with your own\n\n```\n[\n    {\n        \"id\": \"68ee587de3365dea\",\n        \"type\": \"mqtt in\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"\",\n        \"topic\": \"Laptop\",\n        \"qos\": \"2\",\n        \"datatype\": \"auto-detect\",\n        \"broker\": \"7715a72184178191\",\n        \"nl\": false,\n        \"rap\": true,\n        \"rh\": 0,\n        \"inputs\": 0,\n        \"x\": 270,\n        \"y\": 260,\n        \"wires\": [\n            [\n                \"f63a897fbf0460ad\",\n                \"5e5ae2d9cfad85f8\",\n                \"f3f9502a7003f089\",\n                \"df065cd6c88b4e8b\",\n                \"420ff0bba7a7cbe2\",\n                \"c9716270880d3135\",\n                \"49a5c228e64102dc\",\n                \"56cb45a845748ce6\",\n                \"5323ed83dc049965\",\n                \"40f7e260cd17ca73\",\n                \"10f6151b0d8c6f9d\",\n                \"ee79288130de68b1\",\n                \"9ccff470ca2fc817\",\n                \"2c1966a95f9e2761\",\n                \"0b380d539e0bfc8b\",\n                \"bb35db7c5d7dc5b3\",\n                \"491c9a8850117c71\",\n                \"61e87448ede9ac50\",\n                \"f0038b2d1afc638c\",\n                \"e428907093e90395\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"491c9a8850117c71\",\n        \"type\": \"switch\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"MOUSE_LEFT_DOWN\",\n        \"property\": \"payload\",\n        \"propertyType\": \"msg\",\n        \"rules\": [\n            {\n                \"t\": \"eq\",\n                \"v\": \"MOUSE_LEFT_DOWN\",\n                \"vt\": \"str\"\n            }\n        ],\n        \"checkall\": \"true\",\n        \"repair\": false,\n        \"outputs\": 1,\n        \"x\": 590,\n        \"y\": 840,\n        \"wires\": [\n            [\n                \"2415104344d7e653\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"61e87448ede9ac50\",\n        \"type\": \"switch\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"MOUSE_LEFT_UP\",\n        \"property\": \"payload\",\n        \"propertyType\": \"msg\",\n        \"rules\": [\n            {\n                \"t\": \"eq\",\n                \"v\": \"MOUSE_LEFT_UP\",\n                \"vt\": \"str\"\n            }\n        ],\n        \"checkall\": \"true\",\n        \"repair\": false,\n        \"outputs\": 1,\n        \"x\": 570,\n        \"y\": 880,\n        \"wires\": [\n            [\n                \"ec8d695a743ec90b\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"f0038b2d1afc638c\",\n        \"type\": \"switch\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"MOUSE_RIGHT_DOWN\",\n        \"property\": \"payload\",\n        \"propertyType\": \"msg\",\n        \"rules\": [\n            {\n                \"t\": \"eq\",\n                \"v\": \"MOUSE_RIGHT_DOWN\",\n                \"vt\": \"str\"\n            }\n        ],\n        \"checkall\": \"true\",\n        \"repair\": false,\n        \"outputs\": 1,\n        \"x\": 590,\n        \"y\": 920,\n        \"wires\": [\n            [\n                \"74e9b9ce8fca68e1\",\n                \"c18dc4dfb84e51e8\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"e428907093e90395\",\n        \"type\": \"switch\",\n        \"z\": \"9072b355de756fe9\",\n        \"name\": \"MOUSE_RIGHT_UP\",\n        \"property\": \"payload\",\n        \"propertyType\": \"msg\",\n        \"rules\": [\n            {\n                \"t\": \"eq\",\n                \"v\": \"MOUSE_RIGHT_UP\",\n                \"vt\": \"str\"\n            }\n        ],\n        \"checkall\": \"true\",\n        \"repair\": false,\n        \"outputs\": 1,\n        \"x\": 580,\n        \"y\": 960,\n        \"wires\": [\n            [\n                \"7585f81886584946\",\n                \"c18dc4dfb84e51e8\"\n            ]\n        ]\n    },\n    {\n        \"id\": \"7585f81886584946\",\n        \"type\": \"exec\",\n        \"z\": \"9072b355de756fe9\",\n        \"command\": \"export DISPLAY=:0;xdotool mouseup --clearmodifiers 3\",\n        \"addpay\": \"\",\n        \"append\": \"\",\n        \"useSpawn\": \"false\",\n        \"timer\": \"\",\n        \"winHide\": false,\n        \"oldrc\": false,\n        \"name\": \"\",\n        \"x\": 1060,\n        \"y\": 960,\n        \"wires\": [\n            [],\n            [],\n            []\n        ]\n    },\n    {\n        \"id\": \"74e9b9ce8fca68e1\",\n        \"type\": \"exec\",\n        \"z\": \"9072b355de756fe9\",\n        \"command\": \"export DISPLAY=:0;xdotool mousedown 3\",\n        \"addpay\": \"\",\n        \"append\": \"\",\n        \"useSpawn\": \"false\",\n        \"timer\": \"\",\n        \"winHide\": false,\n        \"oldrc\": false,\n        \"name\": \"\",\n        \"x\": 1020,\n        \"y\": 920,\n        \"wires\": [\n            [],\n            [],\n            []\n        ]\n    },\n    {\n        \"id\": \"ec8d695a743ec90b\",\n        \"type\": \"exec\",\n        \"z\": \"9072b355de756fe9\",\n        \"command\": \"export DISPLAY=:0;xdotool mouseup --clearmodifiers 1\",\n        \"addpay\": \"\",\n        \"append\": \"\",\n        \"useSpawn\": \"false\",\n        \"timer\": \"\",\n        \"winHide\": false,\n        \"oldrc\": false,\n        \"name\": \"\",\n        \"x\": 1060,\n        \"y\": 880,\n        \"wires\": [\n            [],\n            [],\n            []\n        ]\n    },\n    {\n        \"id\": \"2415104344d7e653\",\n        \"type\": \"exec\",\n        \"z\": \"9072b355de756fe9\",\n        \"command\": \"export DISPLAY=:0;xdotool mousedown --clearmodifiers 1\",\n        \"addpay\": \"\",\n        \"append\": \"\",\n        \"useSpawn\": \"false\",\n        \"timer\": \"\",\n        \"winHide\": false,\n        \"oldrc\": false,\n        \"name\": \"\",\n        \"x\": 1070,\n        \"y\": 840,\n        \"wires\": [\n            [],\n            [],\n            []\n        ]\n    },\n    {\n        \"id\": \"7715a72184178191\",\n        \"type\": \"mqtt-broker\",\n        \"name\": \"\u003cMQTTBrokerName\u003e\",\n        \"broker\": \"\u003cMQTTBrokerIP\u003e\",\n        \"port\": \"\u003cMQTTPort\u003e\",\n        \"tls\": \"\u003cMQTTBrokerTLS\u003e\",\n        \"clientid\": \"\u003cMQTTBrokerID\u003e\",\n        \"autoConnect\": true,\n        \"usetls\": true,\n        \"protocolVersion\": \"4\",\n        \"keepalive\": \"60\",\n        \"cleansession\": false,\n        \"birthTopic\": \"\",\n        \"birthQos\": \"0\",\n        \"birthPayload\": \"\",\n        \"birthMsg\": {},\n        \"closeTopic\": \"\",\n        \"closeQos\": \"0\",\n        \"closePayload\": \"\",\n        \"closeMsg\": {},\n        \"willTopic\": \"\",\n        \"willQos\": \"0\",\n        \"willPayload\": \"\",\n        \"willMsg\": {},\n        \"userProps\": \"\",\n        \"sessionExpiry\": \"\"\n    },\n    {\n        \"id\": \"\u003cMQTTBrokerTLS\u003e\",\n        \"type\": \"tls-config\",\n        \"name\": \"\",\n        \"cert\": \"\",\n        \"key\": \"\",\n        \"ca\": \"\",\n        \"certname\": \"\",\n        \"keyname\": \"\",\n        \"caname\": \"ca.crt\",\n        \"servername\": \"\",\n        \"verifyservercert\": false,\n        \"alpnprotocol\": \"\"\n    }\n]\n```\n\u003c/details\u003e\n\n          \n### Automation\n\n```\nalias: Mouse Move to MQTT\ndescription: \"\"\ntriggers:\n  - entity_id:\n      - input_number.mouse_y\n    trigger: state\nactions:\n  - data:\n      qos: 0\n      retain: false\n      topic: input_pair/Laptop_Mouse/set\n      payload: \u003e\n        {{ \"{\\\"x\\\": \" + (states.input_number.mouse_x.state) | string + \", \\\"y\\\":\n        \" + (states.input_number.mouse_y.state) | string + \"}\" }}\n    action: mqtt.publish\n  - data:\n      value: 0\n    target:\n      entity_id: input_number.mouse_y\n    action: input_number.set_value\n  - data:\n      value: 0\n    target:\n      entity_id: input_number.mouse_x\n    action: input_number.set_value\nmode: single\n```\n\n#### Mouse Button\n```\nalias: Mouse Left button Down to MQTT\ndescription: \"\"\ntriggers:\n  - entity_id:\n      - input_boolean.mouse_buttonleft\n    to: \"on\"\n    trigger: state\nconditions:\n  - condition: state\n    entity_id: input_select.video_gerat\n    state: Laptop\nactions:\n  - data:\n      topic: Laptop\n      payload: MOUSE_LEFT_DOWN\n    action: mqtt.publish\nmode: single\n```\n\n## Conditional actors\nThe flexibility of the automations allows for conditional actors, meaning the events are send to different devices (even via different protocols) depending on a condition.\n\n### Example\nHere is an example automation of using an input_select condition to send the buttonleft event to either a laptop or a gaming computer.\n\n```\ndescription: \"\"\nmode: single\ntriggers:\n  - entity_id:\n      - input_boolean.mouse_buttonleft\n    to: \"on\"\n    trigger: state\nactions:\n  - choose:\n      - conditions:\n          - condition: state\n            entity_id: input_select.active_playback_device\n            state: Laptop\n        sequence:\n          - action: shell_command.laptop_mouse_leftdown\n            metadata: {}\n            data: {}\n      - conditions:\n          - condition: state\n            entity_id: input_select.active_playback_device\n            state: Gaming\n        sequence:\n          - action: shell_command.gaming_mouse_leftdown\n            metadata: {}\n            data: {}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfranzen%2Fsimple-universal-touchpad-for-homeassistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfranzen%2Fsimple-universal-touchpad-for-homeassistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfranzen%2Fsimple-universal-touchpad-for-homeassistant/lists"}