This question is regarding WEBHOOK-based template sensor, like explained here:
TRIGGER BASED SENSOR AND BINARY SENSOR STORING WEBHOOK INFORMATION
This article mentions that;
Template entities can be triggered using any automation trigger, including webhook triggers. Use a trigger-based template entity to store this information in template entities.
However, I have created a Webhook using automation, following these instructions; Webhooks configuration. I know my Webhook works as this automation gets triggered by the Webhook and actions are executed. The Webhook also works externally, via Nabu Casa Cloud.
However! If I use the same webhook_id in a template sensor, it does NOT get triggered. See my template sensor below:
- trigger:
- platform: webhook
allowed_methods:
- POST
- PUT
local_only: false
webhook_id: <re-used webhook from automation>
sensor:
- name: "ODO meter"
state: "{{trigger.json.vehicle_mileage}}"
unit_of_measurement: km
- name: "fuel level"
state: "{{trigger.json.can.fuel.level}}"
unit_of_measurement: "%"
What am I doing wrong?