EDIT:
I’ve figured out my problem, but not my solution. I have my ifttt automation as follows:
- alias: automate_ifttt
initial_state: true
trigger:
- platform: event
event_type: ifttt_webhook_received
event_data:
action: 'call_service'
action:
- service_template: '{{ trigger.event.data.service }}'
data_template:
entity_id: '{{ trigger.event.data.entity_id }}'
## value: '{{ trigger.event.data.value }}'
The last line is the issue, if I don’t have that line there, my lights work fine, but I can’t set a numeric value. If I uncomment that line, then I can set numeric values, but my lights stop working as they don’t pass a “value” and I get the following error in my logs:
2019-07-31 21:44:16 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1130, in async_call
processed_data = handler.schema(service_data)
File "/srv/homeassistant/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 267, in __call__
return self._compiled([], data)
File "/srv/homeassistant/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 589, in validate_dict
return base_validate(path, iteritems(data), out)
File "/srv/homeassistant/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 427, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['value']
Any idea how to make this automation more flexible so I can use it for both light.turn_on AND input_number.set_value without either one breaking?
– old post below –
I’m trying to pass a numeric value from ifttt to a home assistant input_number, but it doesn’t seem to go, and I get the following error in my log each time:
2019-07-31 21:18:22 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.automate_ifttt. Invalid data for call_service at pos 1: required key not provided @ data[‘value’]
in ha I have the webhook integration configured, and it is confirmed working to turn on/off lights, in ifttt I have:
URL: (this is correct as if it wasn’t, I wouldn’t get the log entry, I’ve also confirmed this works for simple toggles like turning on or off lights)
method: POST
Content Type: application/json
body:
{ “action”: “call_service”, “service”: “input_number.set_value”, “entity_id”:“input_number.guest_entered”, “value”:“1234”}
As far as I can tell, this SHOULD set the input_number.guest_entered to a value of 1234, but instead the value remains zero, and I get the error listed above.
HA version is 0.96.5
I have also tried the services tab within ha to set it using service input_number.set_value, entity input_number.guest_entered and service data:
{
“entity_id”: “input_number.guest_entered”, “value”:“0000”
}
and that works exactly as it should, so I’m not sure why the ifttt doesn’t work.
Anyone have any ideas?