I tried with auth disable as well.
Tried to send it as a cURL script from my xeoma server instead and it works fine.
But dont understand how to send header with the http request from xeoma.
I tried with auth disable as well.
Tried to send it as a cURL script from my xeoma server instead and it works fine.
But dont understand how to send header with the http request from xeoma.
Still have configuration error if one line.
As mentioned on some forum i uset the start a program in xeoma insted. Start program cURL with the header parameters. Not as good att plain http request i xemoma but good enought.
Hereās the exact code I use on my Xeoma server.
#!/bin/bash
curl -X POST \\
-H "Content-Type: application/json" \\
-d '{"state": "on", "attributes": {"device_class": "motion", "friendly_name": "Driveway Cam 1 Motion"}}' \
http://192.168.10.100:8123/api/states/binary_sensor.driveway_cam1_motion
I donāt use HTTP Auth on my system because itās not Internet facing at all so I donāt have a need for Auth.
Scripts:
driveway_cam1_on.sh
driveway_cam1_off.sh
The only difference in the on/off is the state that I send in the curl command change the āstateā: āonā section to either on or off.
I then use the Xeoma run script function or āApplication Runnerā. Thereās 2 instances of Application runner. 1 for āonā and 1 for āoffā.
I got it working at the command prompt
curl -X POST -H "x-ha-access: xxxxxxxxxxxxx" -H "Content-Type: application/json" -d '{"state": "on", "attributes": {"attribute_name": "attribute_value"}}' https://xxxxxx.duckdns.org:8123/api/states/climate.panasonic_aircon
and now I have it working using the rest_command too:
Configuration.yaml
rest_command:
set_climate_to_on:
method: POST
url: 'https://xxxxxxxxxxxxx.duckdns.org:8123/api/states/climate.panasonic_aircon'
headers:
content-type: application/json
password: xxxxxxxxxxxx
payload: '{"state": "on", "attributes": {"current_temperature": {{ states.sensor.temperature_158d0001f52edb.state }}, "min_temp": 16, "max_temp": 30, "temperature": {{ states.sensor.climate_temperature.state }}, "target_temp_step": 1, "fan_mode": "{{ states.sensor.climate_temperature.state }}", "fan_list": ["low", "mid", "high", "auto"], "operation_mode": "off", "operation_list": ["off", "cool", "heat", "on"], "unit_of_measurement": "Ā°C", "friendly_name": "Heat Pump", "supported_features": 193}}'
sensor:
- platform: template
sensors:
climate_temperature:
value_template: "{{ states.climate.panasonic_aircon.attributes['temperature'] }}"
climate_fan_mode:
value_template: "{{ states.climate.panasonic_aircon.attributes['fan_mode'] }}"
Automation.yaml
- alias: "Set AC to ON"
trigger:
action:
- service: rest_command.set_climate_to_on