# \[Beginner\] Heiman smoke detector - start alarm/siren with a command?

**URL:** <https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898>\
**Category:** General Support\
**Created:** [November 27, 2022, 12:00pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898 "2022-11-27T12:00:43Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [December 10, 2022, 6:40pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/21 "2022-12-10T18:40:04Z")

</div>

Ok it seem spaces are problem on windows

```auto
curl -X PUT http://MY-IP:8090/api/MY-API/lights/27/state -d '{"alert":"lselect","ontime":10}'

```

---

<div class="post-metadata">

**Author:** ![wosch](https://forum.phoscon.de/letter_avatar_proxy/v4/letter/w/58956e/32.png) [@wosch](https://forum.phoscon.de/u/wosch)\
**Post date:** [December 11, 2022, 3:50pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/22 "2022-12-11T15:50:46Z")

</div>

syntax seems to be ok now, but what about the invalid JSON?

```auto
[{"error":{"address":"/lights/27/state","description":"body contains invalid JSON","type":2}}]

```

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [December 11, 2022, 5:09pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/23 "2022-12-11T17:09:24Z")

</div>

So now it’s a deconz error message ^^, it’s better  
Try with removing the `"ontime":10` I have see on an issue, but I m not sure if it’s needed.

---

<div class="post-metadata">

**Author:** ![wosch](https://forum.phoscon.de/letter_avatar_proxy/v4/letter/w/58956e/32.png) [@wosch](https://forum.phoscon.de/u/wosch)\
**Post date:** [December 11, 2022, 5:30pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/24 "2022-12-11T17:30:26Z")

</div>

the same error occurs without ontime:

```auto
C:\Users\wosch>curl -X PUT http://MY-IP:8090/api/MY-API/lights/27/state -d '{"alert":"lselect"}'
[{"error":{"address":"/lights/27/state","description":"body contains invalid JSON","type":2}}]

```

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [December 12, 2022, 3:42pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/25 "2022-12-12T15:42:16Z")

</div>

You are usng Cmd.exe or powershell ?  
I think it’s a character escape issue, and I don’t found sample on google with command line that use ’ instead of " for windows…

```auto
curl -X PUT http://MY-IP:8090/api/MY-API/lights/27/state -d "{\"alert\":\"lselect\",\"ontime\":10}"

```

Tested on my side

```auto

C:\Users\Smanar>curl -X PUT http://192.168.1.1/api/10C78A0F47/lights/1/state -d "{\"on\":true}"
[{"error":{"address":"/lights/1/state","description":"parameter, on, not available","type":6}},{"error":{"address":"/lights/1/state","description":"missing parameter to set light state","type":5}}]

```

---

<div class="post-metadata">

**Author:** ![wosch](https://forum.phoscon.de/letter_avatar_proxy/v4/letter/w/58956e/32.png) [@wosch](https://forum.phoscon.de/u/wosch)\
**Post date:** [December 14, 2022, 5:27pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/26 "2022-12-14T17:27:54Z")

</div>

I tried with cmd.  
Beside of curl, is there any other option to fire the siren?

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [December 14, 2022, 5:46pm UTC](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898/27 "2022-12-14T17:46:06Z")

</div>

Sure REST plugin in your browser [Getting Started - deCONZ REST-API](https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/)

[Previous page](https://forum.phoscon.de/t/beginner-heiman-smoke-detector-start-alarm-siren-with-a-command/2898.md?page=1)
