Welcome to Animus Talk

This is where users of Animus Heart can share ideas,
solve problems and inspire fellow enthusiasts.

Animus Heart?

Problems with updating a function (virtual dimmer) over a HTTP request

Hi!

I got this virtual dimmer that I want to update by a HTTP request,

Im reading the documentation and have figured out that the request should look something like this.

curl -H “Authorization: Bearer LKAJSDLKASJDKLASJDALSKDJASD” “192.168.1.96/ctions/com.animushome.heart.packages.virtual:2:multilevel/functionProperties/data” -d ‘{“level”:24}’

But that doesnt work.

Can anyone point out where the error is?

Thanks,

Markus

Hi @markus.dahlberg

You need to add an extra header Content-Type: application/json

Try this

curl -H "Authorization: Bearer LKAJSDLKASJDKLASJDALSKDJASD" -H "Content-Type: application/json" "192.168.1.96/rest/functions/com.animushome.heart.packages.virtual:2:multilevel/functionProperties/data" -d '{"level":24}'
1 Like

nope, same error code as earlier…

Can there be a error in this part of the request? /rest/functions/com.animushome.heart.packages.virtual:2:multilevel/functionProperties/data

Without having tried it, I would say you could try two things;

  1. You are missing “-X PUT” in front of the device IP (indicates you want to set a value)
  2. Change “…/rest/functions/” to "…/rest/devices/

as in;

curl 
-X PUT "$host/rest/devices/com.animushome.heart.device.led-1"
-H "Authorization: Bearer mysmarthomekey"
-d '{"name":"My Halo","animus_area":"area-2-1537883537722", "is_favorite": false}'

Taken from the API documentation: update-a-device

2 Likes