Site updated at 2016-06-04 15:40:20 UTC
This commit is contained in:
parent
41be8cb2c7
commit
d214dd5fb3
26 changed files with 67 additions and 45 deletions
|
@ -123,7 +123,8 @@ You should choose a unique device name (DEVICE_NAME) to avoid clashes with other
|
|||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \
|
||||
http://localhost:8123/api/states/binary_sensor.radio
|
||||
-H "Content-Type: application/json" \
|
||||
http://localhost:8123/api/states/binary_sensor.radio
|
||||
{
|
||||
"attributes": {
|
||||
"friendly_name": "Radio"
|
||||
|
@ -161,7 +162,7 @@ print(response.text)
|
|||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ http -v POST http://localhost:8123/api/states/binary_sensor.radio \
|
||||
x-ha-access:YOUR_PASSWORD state=off \
|
||||
x-ha-access:YOUR_PASSWORD content-type:application/json state=off \
|
||||
attributes:='{"friendly_name": "Radio"}'
|
||||
</pre></div>
|
||||
</div>
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"payload": "Test message from HA", "topic": "home/notification"}' \
|
||||
http://IP_ADDRESS:8123/api/services/mqtt/publish
|
||||
</pre></div>
|
||||
|
|
|
@ -112,7 +112,8 @@ You should choose a unique device name (DEVICE_NAME) to avoid clashes with other
|
|||
<p>For a quick test <code>curl</code> can be useful to “simulate” a device.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ curl -XPOST -H "x-ha-access: YOUR_PASSWORD" \
|
||||
<div class="code"><pre>$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state": "20", "attributes": {"unit_of_measurement": "°C", "friendly_name": "Bathroom Temp"}}' \
|
||||
http://localhost:8123/api/states/sensor.bathroom_temperature
|
||||
</pre></div>
|
||||
|
@ -123,7 +124,8 @@ You should choose a unique device name (DEVICE_NAME) to avoid clashes with other
|
|||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \
|
||||
http://localhost:8123/api/states/sensor.bathroom_temperature
|
||||
-H "Content-Type: application/json" \
|
||||
http://localhost:8123/api/states/sensor.bathroom_temperature
|
||||
{
|
||||
"attributes": {
|
||||
"friendly_name": "Bathroom Temp",
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
<p>Check if you are able to access the device located at <code>http://IP_ADRRESS</code>. The details about your switch is provided as a JSON response.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ curl -X GET http://IP_ADDRESS/report
|
||||
<div class="code"><pre>$ curl -X GET -H "Content-Type: application/json" http://IP_ADDRESS/report
|
||||
{
|
||||
"power": 0,
|
||||
"relay": false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue