Storing Webhook Data

Tags: #<Tag:0x00007f3269d596c8>

Hi everyone,

I’m trying to collect data from a sensor that is periodically transmitted via a webhook. I have created an automation to link the webhook to, but I am unsure of the best way to store the data. It feels like I should be using a “Webhook Sensor” rather than an automation, but there isn’t one, as far as I am aware.

My current approach is to use input numbers ( yet to get it working ), but is there a better way to achieve what I am after? Can I use a template sensor somehow?

# in automation.yaml
- alias: brew_brewfather_wh
  trigger:
    platform: webhook
    webhook_id: wh_ispindel
  action:
    - service: input_number.set_value
      data_template:
        entity_id: input_number.brew_ispindel_temp
        value: "{{ trigger.data.temp }}"

Thanks in advance for any help!
Cheers,
Michael.

I’d like to chime in on this one - so far this is also my way of doing it (Sonnenbatterie with APIv2 / Webhook).
As good as it works so far, there might be a better way :slight_smile:
Thanks!

Thanks for the link, great to look over and check it out.
It does seem to work - but I also have to admit that a sensor rather an input_number makes much more sense.

I may have a look at templating a sensor to do it. I’m pretty new to this, but will the rest platform work to receive webhook data? I suspect not.