Automation with curl (Home Assistant)

home-assistant
client-apps
integration
home-automation
Tags: #<Tag:0x00007fe3b6473618> #<Tag:0x00007fe3b6467e80> #<Tag:0x00007fe3b6467d18> #<Tag:0x00007fe3b6467bb0>

#1

Would this be the correct curl command to send an open command?
$curl -X POST https://api.particle.io/v1/devices/XXXXXXXX/setState -Hcontent-type:application/x-www-form-urlencoded -d access_token=YYYYYYYY&arg=open

where XXXXXXX is deviceid and YYYYYYYY is the token.


#2

Yes, but it also works without content-type header:

curl https://api.particle.io/v1/devices/XXX-DEVICEID-XXX/setState -d arg="open" -d access_token=YYY-ACCESS-TOKEN-YYY

Please find more details and examples in Particle Cloud API. The list of supported functions, variables and events can be found in Garadget’s Firmware at GitHub.

I look forward to seeing more info about your project when finished.


#4

For those who’s still finding this older post: here’s now a native Garadget support in Home Assistant.