Hi,
I’m trying to configure a switch with rest_command component and some sensors that I have already, but I can’t get it to work.
This is my configuration, and I have tested the rest_command component with the “developer tools” and it works correctly.
rest_command:
airzone_on:
url: http://localhost:3000/api/v1/hvac
method: PUT
payload: '{"systemID":1,"zoneID":{{ zoneid }},"on":{{ on }}}'
content_type: 'application/json; charset=utf-8'
switch:
- platform: template
switches:
blueface:
friendly_name: "Blueface On/Off"
value_template: "{{ is_state('sensor.blueface_status', 'Running') }}"
turn_on:
service: rest_command.airzone_on
data:
zoneid: 1
on: 1
turn_off:
service: rest_command.airzone_on
data:
zoneid: 1
on: 0
I use the “paidload” to have a more generic rest_command. With developer tools, call service: rest_command.airzone_on --> data, {“zoneid”:1,“on”:1}, all ok
But, if now with the switch definition, you add it to a card, when I activate the switch it gives me an error: "Failed to call service switch / turn_on. Keywords must be strings"
Can anyone give me some help?
Thks in advance.