0.80: Lovelace updates, webhooks, TRÅDFRI switches

I really love the work that has been done for the webhooks. Just in case anyone is wondering how to use it:

Rugular data:

automation:
  trigger:
    platform: webhook
    webhook_id: test
  action:
    service: logbook.log
    data_template:
      name: testlog
      message: >
        {{ trigger.data.a }}

And call it from Python like this:

import requests
requests.post("http://192.168.1.123:8123/api/webhook/test", data={"a":1})

JSON encoded:

automation:
  trigger:
    platform: webhook
    webhook_id: test
  action:
    service: logbook.log
    data_template:
      name: testlog
      message: >
        {{ trigger.json.a }}

And call it from Python like this:

import requests
import json
requests.post("http://192.168.1.123:8123/api/webhook/test", data=json.dumps({"a":1}), headers={"Content-type":"application/json"})
12 Likes