Hello.
I use REST requests to get and send water data. The requests where I need to get information work fine, return data, and I process it in the program.
The problem is that the request that sends data to the server does not return any information after execution, except for the response about the status 200, 400, etc. depending on the execution state. If in http or curl I can see these statuses and work with them, then in REST I do not understand how to catch them.
I have reread all the official documentation and searched for an answer on the forum for a long time. I do not understand how to get and output this response to the sensor.
If someone helps and points me in the right direction, I will be very grateful.
Request code.
- resource_template: https://xxx.yy/api/clients/meters/{{- states('sensor.me_id_coldwater') -}}/value
scan_interval: 31557600
method: POST
params:
withCheck: true
headers:
Content-Type: application/json;
X-Auth-Tenant-Token: "{{- states('sensor.me_token') -}}"
payload_template: >
{{ {"value": states('sensor.weter_coldwater')} | to_json }}
sensor:
- name: "me_send_coldwater"
unique_id: 151bc70b-59ce-4fae-ad06-eab7aec0f873
icon: mdi:receipt-text-send-outline