FA21RF (/2) can't be controlled from Domoticz?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
void
Posts: 26
Joined: Wednesday 04 November 2015 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

FA21RF (/2) can't be controlled from Domoticz?

Post by void »

Hi all,

I've bought the FA21RF/2 (a set of two) for two reasons:
- In case of a smoke alarm (Panic status) send me a Telegram message via my Telegram bot.
- In case of a breach (motion or magnet contact detection) make the smoke detectors sound an alarm.

The two FA's are in master/slave mode and are added as a single KD101 security switch in Domoticz.
Pressing the test button on either one of them raises a Panic status in Domoticz, so communication is going fine for one way.
When I click the button in Domoticz the alarm at both FA's goes off as well, commucations both directions are a-okay.
But for whatever reason I cannot active the alarm via bash/shell.

Simpel test script I wrote:

Code: Select all

 
$ cat smoke.sh

#!/bin/sh
DOMO_IP="192.168.1.60"         # Domoticz IP Address
DOMO_PORT="8080"                 # Domoticz Port
SMOKE_IDX="518"                  # Smoke Detectors IDX
/usr/bin/curl --data chat_id=<TELEGRAM ID> --data-urlencode "text=SMOKE ALARM"  "https://api.telegram.org/bot<BOT ID>:<BOT KEY>/sendMessage"
sleep 10
/usr/bin/curl -s -i -H "Accept: application/json" http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=resetsecuritystatus&idx=$SMOKE_IDX&switchcmd=Normal
I receive the following error (Telegram message works fine)
[/ HTTP/1.1 200 OK
Content-Length: 24
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Allow-Origin: *

{
"status" : "ERR"
}
Anyone has an idea what I'm doing wrong?
I've read several treads but can't seem to find a good example.

Cheers,
Void.
SweetPants

Re: FA21RF (/2) can't be controlled from Domoticz?

Post by SweetPants »

Should there not be "" arround the HTTP call and all on one line?
void
Posts: 26
Joined: Wednesday 04 November 2015 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: FA21RF (/2) can't be controlled from Domoticz?

Post by void »

EDIT: Tried it with:

Code: Select all

/usr/bin/curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=resetsecuritystatus&idx=$SMOKE_IDX&switchcmd=Normal"
and gives back this:
HTTP/1.1 200 OK
Content-Length: 51
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Allow-Origin: *

{
"status" : "OK",
"title" : "SwitchLight"
}
However, this isn't a SwitchLight command but a (re)set of security status, right?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest