Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95493

Dynamic parameters from IFTTT Webhook

$
0
0

@cnschulz wrote:

Gday,

Ive used IFTTT webhooks to control binary devices for some time however I’d also like to set the volume of the amplifier using a numeric parameter. Im not sure how I can (using a service template??) ignore/include parameters based on the type of action being performed. In this case there is just one numeric parameter that is needed for volume but not needed for on/off actions.

This is working fine for the volume action:

- id: this_is_the_automation_id
  alias: The optional automation alias
  trigger:
  - event_data: {}
    event_type: ifttt_webhook_received
    platform: event
  condition: []
  action:
    service_template: '{{ trigger.event.data.service }}'
    data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'
      volume_level: '{{ trigger.event.data.volume_level }}'

Id like to do something like this:

    service_template: '{{ trigger.event.data.service }}'
    data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'
      if ( '{{ trigger.event.data.service == "media_player.volume_set }}' ) then volume_level: '{{ trigger.event.data.volume_level }}' else <blank_not_needed>

i.e. optionally include the volume_level: parameter when needed.

Excuse my psuedocode.

Any help appreciiated

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95493

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>