Coder Social home page Coder Social logo

hendricksond / streamdeck-homeassistant-webhook Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 2.0 66 KB

Call Home Assistant webhooks from the Elgato Stream Deck.

HTML 3.73% JavaScript 17.25% CSS 79.02%
elgato elgato-stream-deck stream-deck home-assistant streamdeck-sdk streamdecksdk smarthome javascript plugin hassio

streamdeck-homeassistant-webhook's Introduction

Home Assistant Webhooks for Elgato Stream Deck

Use the Elgato Stream Deck to call Home Assistant webhooks.

This plugin should work on both Windows 10 and macOS.

Based on the streamdeck-ifttt plugin by tobimori. The main difference is that this plugin lets you call Home Assistant webhooks directly, without using IFTTT as a middleman.

How to use

You will need to define webhooks in your Home Assistant automations configuration, then configure the Stream Deck's buttons to call the webhooks.

Installation

Download the latest release, then execute the file. You will be asked if you want to install the file. Click yes, and the plugin will be installed.

Creating an Automation

You will need to create a Webhook Trigger in your Home Assistant automations configuration. Here is an example of a basic trigger:

- id: webhook_brightness
  alias: "Brightness Webhook"
  trigger:
  - platform: webhook
    webhook_id: replace_this_with_some_random_text
  action:
  - service: light.turn_on
    data:
      entity_id: light.office, light.living_room
      brightness_pct: 50

For generating the webhook_id, I recommend using a CodeIgniter Encryption Key from randomkeygen.com, but you are welcome to use any text you want. Just be aware that there is no additional authentication on the URL. Anyone with access to the webhook_id can run your automation.

For a more advanced configuration, you can use the optional service, entities, and parameter fields. Here is an example of a configuration using the optional fields:

- id: webhook_brightness
  alias: "Brightness Webhook"
  trigger:
  - platform: webhook
    webhook_id: replace_this_with_some_random_text
  action:
  - service_template: '{{ trigger.json.service }}'
    data_template:
      entity_id: '{{ trigger.json.entities }}'
      brightness_pct: '{{ trigger.json.parameter }}'

Configuring a button

Drag and drop the Webhook Button action from the Home Assistant category in the action list to an open button. Click the button to configure it. Fill out the fields.

Server URL

The base URL of your server. Do not include a trailing slash.

Example: http://192.168.1.2:8123

Webhook ID

The random text that you generated (or picked) for the webhook_id in your automation configuration.

Example: replace_this_with_some_random_text

Service

The optional service you would like to call. Accessible in your automation configuration as trigger.json.service.

Example: light.turn_on

Entities

One or more comma-separated entities. Accessible in your automation configuration as trigger.json.entities.

Example: light.office, light.living_room

Parameter

A raw value that you can use in your automation. Maybe a brightness level, or a color name, or some other useful data. Accessible in your automation configuration as trigger.json.parameter.

Example: 50

Support

If you find a bug, please create an issue. Provide as much information as possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.