Automation with curl (Home Assistant)

client-apps
home-automation
home-assistant
integration
Tags: #<Tag:0x00007fad70ef88f8> #<Tag:0x00007fad70ef87b8> #<Tag:0x00007fad70ef8628> #<Tag:0x00007fad70ef84c0>

#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.