XaF/qolsysgw

Trying to trigger Fire or Auxiliary, API Error: Call-service Error

Closed this issue · 6 comments

Before submitting this form

  • I have checked that there hasn't been a similar issue submitted in the past

  • I have updated the issue title to something relevant and clear to understand the bug I'm facing

Description of the bug

I'm trying to trigger a Fire or Auxiliary alarm. When I enter anything other than {"Code":"1234"} into the "Data" field in node red, I get a call-service error saying extra keys not allowed.

How do you call a fire or auxiliary alarm from the call service options? I feel like there should be a alarm_trigger_police, alarm_trigger_fire, and alarm_trigger_auxiliary service call.

I've tried entering in the following "Data" fields and I get the same extra keys error.

{
"action": "TRIGGER_FIRE",
"partition_id": 0"
}

{
"action": "ALARM",
"alarm_type": "FIRE",
"partition_id": 0
}

Expected behavior

The panel would trigger a fire or auxiliary alarm.

DEBUG logs

Nothing in logs.

Additional context

How do you call a triggered alarm for fire or auxiliary? Perhaps I'm doing it incorrectly?

Still beating my head against the wall, with the call service alarm_trigger I can trigger the police alarm. But I can't pass the alarm_type through the data field, it will only accept a code. How do you call the action for triggering fire/auxiliary?

I think I figured it out a bit, I have to trigger an action to send an MQTT message, but how do I get it to generate a session_token?

Got it figured out, if anyone else finds this page, if you are using node red, you have to store the sessionToken call a function node that is configured like the following:

// Get the session_token from the flow context
var sessionToken = variable.get("session_token");

// Create the alarm command payload
var payload = {
action: "ARM_AWAY",
bypass: false,
delay: 0,
partition_id: 0,
session_token: sessionToken
};

msg.payload = payload;
return msg;

Then you pipe that function output into a MQTT out node with the toping set to "homeassistant/alarm_control_panel/qolsys_panel/set"

This will send commands through node red flows.

I'm still trying to figure out how to send silent alarms (IE Silent Police from the Panel)

If it helps anyone, I created input_booleans and binary_sensors (who's state is equal to the input booleans) in HA. I'm using alarmo to mimic my alarm, and by adding the binary sensors to alarmo and having automations set the input_boolean variables, that allows me to trigger both the IQ4 and Alarmo at the same time and send custom alarm calls for Fire, Police, and EMS (Auxiliary). Having icons on the alarmo dashboard for setting these input booleans gives me the same functionality as the keypad (minus the silent feature).

XaF commented

Have you taken a look at the user_control_token configuration parameter? It should avoid you needing a session token for sending your commands. The goal of the session token is to avoid relics of previous sessions to be interpreted by qolsysgw in case of a restart, but passing the user control token as the session token is also allowed when set. You should be able, with it, to simply trigger alarms from the mqtt service by making the right control call.

Unfortunately, it's not possible to offer directly the fire/police/aux options of the panel in home assistant as alarm parameters. It would have been nicer!

Sorry, I just saw this reply.

I see where you mention that. I set this in my apps.yaml and then instead of setting a session_token in the MQTT message, I have it set a user_control_token but it's not taking my MQTT commands. Do I still call it a session_token but put the user control token where I would put the session token?

My MQTT data looks like this:
var payload = {
action: "ARM_AWAY",
bypass: false,
delay: 0,
partition_id: 0,
user_control_token: "[redacted]"
};

Also, is there a command to trigger a silent alarm? I'm particularly interested in this for the Auxiliary alarm/silent panic button.

Just to ping this again. How do I find my user_control_token?

To confirm, you can't trigger silent alarms or bypass the siren?

I did find a way to trigger aux/fire/police from within HA. I created input booleans for fire, ems, police. I then created binary sensors in my configuration to trigger on/off based on the input booleans. I then added the binary sensors to Alarmo as environmental sensors and when alarmo is triggered, I have it check what triggered it. If it's one of the panic alarms (fire/ems) I have it trigger the appropriate alarm on my IQ4. However, when the police panic alarm is tripped, I have it send the duress code to my alarm company rather than a standard alarm trip. Disarming the alarm resets the booleans.