Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.18 KB

home_Assistant_REST_Buttons.md

File metadata and controls

65 lines (51 loc) · 1.18 KB

Make a REST call

Using:

Open a door via POST

Add token and URL into secrets.yaml

# REST Secrets
pl_url: URL
pl_nonce: TOKEN

REST

Make a rest action one for all. Rest is imported in configuration.yaml

# REST
rest_command: !include rest.yaml

Method:

open_doors:
  url: !secret pl_url
  method: POST
  content_type: "application/x-www-form-urlencoded"
  payload: "dom={{dom}}&gate={{gate}}&mode={{mode}}&nonce={{nonce}}"

Button

Add button with arguments for each door:

show_name: true
show_icon: true
type: button
tap_action:
  action: perform-action
  target: {}
  data:
    dom: HOMENAME
    gate: GATENAME
    mode: ANOTHER_ARG
    nonce: TOKEN
  perform_action: rest_command.open_doors
icon: mdi:button-pointer
hold_action:
  action: none
icon_height: 48px
name: Button TST