I am getting very confused about Rest commands.
I have an action in a script that should just post the following:
"http://xxxxxxxxxi/water-tank-back/insert_data.php?dist={{ cmvalue }}"
cmvalue is a sensor value that is literally just a float number in text form e.g. 38.1
All this call should do is pass that cmvalue into a php file on a web page.
I have tried many things but currently, I have this:
in configuration.yaml:
rest_command: !include rest_commands.yaml
in rest_commands.yaml:
water_tank_back_garden_cmd:
url: "http://raspberrypihifi/water-tank-back/insert_data.php?dist={{ cmvalue }}"
method: POST
action in my script:
- service: rest_command.water_tank_back_garden_cmd
data:
cmvalue: "{{ states('input_text.water_tank_back_garden_distance_in_cm' }}"
I get 2 related issues in the script:
-
Error in describing action: Cannot read properties of undefined (reading ‘water_tank_back_garden_cmd’)
-
If I actually carry on and try to run that step, it does not recognise rest_command.water_tank_back_garden_cmd
I have used rest: rather than rest_command: for other calls in my system but these do not seem compatible. I really am struggling here with the simplest of calls. Anyone help?