Hello, I have tested
rest_cammand:
dsh_switch_on:
name: 'DSH rest function'
url: http://192.168.3.125/HA/rest.php
method: POST
headers:
accept: "application/json, text/html"
user-agent: 'Mozilla/5.0 {{ useragent }}'
content_type: 'application/json; charset=utf-8'
payload: '{"action":"status", "status":"{{status}}"}'
switch:
- platform: rest
name: 'Test Rest function'
resource: http://192.168.3.125/HA/rest.php
body_on: '{"status":"true", "action":"status"}'
body_off: '{"status":"false", "action":"status"}'
is_on_template: "{{ value_json.is_active }}"
headers:
Content-Type: application/json
I follow to:
I have small php code that accept and write to a log file all incomes data.
{"method":"GET","payload":[],"action":null,"time":"16:58:31","ip":"192.168.3.125","status":""}
Unfortunately I can’t receive/get payload. Both of methods call php without payload. Even the method aren’t same as I call from HA.
Can somebody help me with it?