Deconz: new REST endpoint for alarm system

Sorry…

{
“1”:{
“config”:{
“armed_away_entry_delay”:0,
“armed_away_exit_delay”:0,
“armed_away_trigger_duration”:0,
“armed_night_entry_delay”:0,
“armed_night_exit_delay”:0,
“armed_night_trigger_duration”:0,
“armed_stay_entry_delay”:0,
“armed_stay_exit_delay”:0,
“armed_stay_trigger_duration”:0,
“armmode”:“disarmed”,
“configured”:true,
“disarmed_entry_delay”:0,
“disarmed_exit_delay”:0
},
“devices”:{
“00:0d:6f:00:13:4e:bf:8c-01-0501”:{
“armmask”:“none”
}
},
“name”:“Huset”,
“state”:{
“armstate”:“disarmed”,
“seconds_remaining”:0
}
}
}

I can´t figure out how my code should be to create a second alarmsystem…

https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/alarmsystems/#create-alarm-system

you can use the deconz.configure service in home assistant, based on the first example in create-alarm-system it should be something like

{"field": "/alarmsystems", "data": {"name": "Guest house alarm system"}}

Ok, but were should i set this string?
Configuration payload?

I copy paste your example with wrongmessage…

Thanks for your help!!

But i dont understand how i should use it…
i´m a newbee on this…

Ok, lets take a step back. Do you not know how to use services or is it that you don’t understand to apply my suggestions on the service?

I´m not sure how to use service and how to think in deConz and REST API.

Newbee…

Ok. Then you need to look into how home assistant services work and then you can revisit what I wrote about the deConz configure service. :slight_smile:

You can find a lot on the home assistant web page and look in the forums.

Using the services aren’t more complicated than visiting the services page in your ha instance, selecting the deConz configure service and follow the instructions

Ok.
The only problem i have is how i should change this line, so i can made a second alarmsystem.

curl -X POST http://172.30.33.3:40850/api//alarmsystems

This line create a default alarmsystem with id 1.

You need to add the required parameter Alarm Systems - deCONZ REST-API

Like I wrote before { "name": "Guest house alarm system" }

Yes i understand that. And beleive me, i have try to figure out how. There is why i hope for help here…
I can´t be the only one as want to use multiple alarmsystems…

You can achieve the same thing using the configure service in hass

Saw an example that you might be able to copy pieces from After DDF modification got duplicate clusters with 0xff endpoint - #12 by BabaIsYou - Advice - deCONZ Community

Thx

I already test it…

curl -H ‘Content-Type: application/json’ -X PUT -d ‘{“name”: “Garage”}’ “ADRESS:40850”/api/key/alarmsystems/
[{“error”:{“address”:"/alarmsystems",“description”:“method, PUT, not available for resource, /alarmsystems”,“type”:4}}]

curl -H ‘Content-Type: application/json’ -X PUT -d ‘{“name”: “Garage”}’ “ADRESS:40850”/api/key/alarmsystems/2/
[{“error”:{“address”:"/alarmsystems/2",“description”:“resource, /alarmsystems/2, not available”,“type”:3}}]

curl -H ‘Content-Type: application/json’ -X PUT -d ‘{“name”: “Garage”}’ “ADRESS:40850”/api/key/alarmsystems/2
[{“error”:{“address”:"/alarmsystems/2",“description”:“resource, /alarmsystems/2, not available”,“type”:3}}]

curl -H ‘Content-Type: application/json’ -X PUT -d ‘{“name”: Garage}’ “ADRESS:40850”/api/key/alarmsystems/2/config
[{“error”:{“address”:"/alarmsystems/2",“description”:“resource, /alarmsystems/2, not available”,“type”:3}}]

Change PUT to POST

Hello!

Sorry to say, but it don´t work…

curl -H ‘Content-Type: application/json’ -X POST -d ‘{“name”: “Garage”}’ http://172.30.33.3:40850/api/XXXXXXXXXX/alarmsystems/2/
[{“error”:{“address”:"/alarmsystems/2",“description”:“method, POST, not available for resource, /alarmsystems/2”,“type”:4}}]

Remove the 2 from the path, it doesn’t exist yet. You’re creating it by adding the name to the main endpoint

curl -H ‘Content-Type: application/json’ -X POST -d ‘{“name”: “Garage”}’ http://172.30.33.3:40850/api/XXXXXXXXXX/alarmsystems/

Thx for your help!
Test it, but i don´t get some response…

[core-ssh ~]$ curl -H ‘Content-Type: application/json’ -X POST -d ‘{“name”: “Garage”}’ http://172.30.33.3:40850/api/XXXXXXXXXX/alarmsystems/
[core-ssh ~]$