Risco Lightsys alarm system - Domoticz

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

I tried to replace the whole function read with a message that Domoticz would pick up like in an earlier post, but it didn't work ;-) it would be too simple.

Code: Select all

if (msg.payload === {"id":0,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"Wejscie","strTimeval":""}) {
    msg.payload = {"command":"udevice","idx":310,"nvalue":0,"svalue":""};
} else  if (msg.payload === {"id":0,"bypassed":false,"filter":"triggered","classAttrib":"","data_icon":"detector2","name":"Wejscie","strTimeval":""}) {
    msg.payload = {"command":"udevice","idx":310,"nvalue":1,"svalue":""};
}
return msg;
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by FireWizard »

@zabinskiwojciech ,

Hello.

Let me first explain, what I understand from your yesterdays posts.

I think we can differentiate 8 possible situations for each detector.
I assume that the detectors are all the same and are motion detectors.

Detector Enabled means: capable to send an Alarm (Equals to bypassed set to false)
Detector Disabled means: not capable to send an Alarm (Equals to bypassed set to true or unbypassed)


Situation 1: Panel is Disarmed, Detector is "Enabled", Detector is Not in Alarm (No Motion)===> Result No Alarm (Normal)
Situation 2: Panel is Disarmed, Detector is "Disabled", Detector is Not in Alarm (No Motion)===> Result No Alarm (Normal)
Situation 3: Panel is Disarmed, Detector is "Enabled", Detector is in Alarm (Motion) ===> Result No Alarm (Normal)
Situation 4: Panel is Disarmed, Detector is "Disabled", Detector is in Alarm (Motion)===> Result No Alarm (Normal)
Situation 5: Panel is Armed, Detector is "Enabled", Detector is Not in Alarm (No Motion)===> Result No Alarm (Normal)
Situation 6: Panel is Armed, Detector is "Disabled", Detector is Not in Alarm (No Motion)===> Result No Alarm (Normal)
Situation 7: Panel is Armed, Detector is "Enabled", Detector is in Alarm (Motion) ===> Result Alarm (ALARM!)
Situation 8: Panel is Armed, Detector is "Disabled", Detector is in Alarm (Motion)===> Result No Alarm (Normal)

Do you agree with that? Is this correct?

So we should be able to detect

1. Panel Disarmed or Armed (Already arranged)
2. Detector Enabled or Disabled
3. Detector in Alarm or Not in Alarm

If I return to the picture of the MQTT Explorer, you posted on April 8, I see that for each detector, there exist another subtopic.
(But the arrow is closed, so I do not know which subtopic)

But on your post of April 9 you showed a link to the log files.
In that log files I found for each detector (as an example i take the detector with ID 11):
9.04.2021, 22:59:53node: d5db67ff.4ad8a8riscopanel/dects/11 : msg.payload : string[116]
"{"id":11,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"POK.3 Pietro","strTimeval":""}"
9.04.2021, 22:59:53node: e135fc8c.2c149msg : string[40]
"Unexpected token a in JSON at position 0"
9.04.2021, 22:59:53node: d5db67ff.4ad8a8riscopanel/dects/11/status : msg.payload : string[6]
"active"
In the two last lines you will see: riscopanel/dects/11/status : msg.payload : string[6]
"active"

So obviously the subtopic under dects is the ID of the detector (11) and status.
The value is a string, currently "active"

I do not know, which values this one can have . It is clear that "active" is one of them, but also "inactive"? Or other value?
Is this the value, where we are looking for? (Active = Alarm?? or Inactive = No Alarm)

Can you check this by clicking on the arrow before the number and check what values are presented?

So, again, what we see is that the topic dects consists of a number of subtopics and a string (count).
Each subtopic consists of a JSON object and a subtopic, that consists of a string.
We cannot handle that in one stream with one topic in the MQTT node.

In your post of 11 Apr 2021, 19:09 you said:
I entered MQTT in the Topic position - riscopanel / dects / #
But something is still missing and I think not to change it to functions.
In the Json tile, I changed Property to string and there is no token error anymore.
This will handle all subtopics of dects (Remember # represents a wildcard) and as explained above, it will not work.

In your post of 11 Apr 2021, 19:20 you said:
but I can't find the status in mqtt explorer too much when the detector detects motion, the bypassed status is deciphered but I can't see the motion detected.
Have a look to the status subtopic, as explained above

In your post of 11 Apr 2021, 22:53 you said:
I don't know if I analyzed it well, but this is the state of motion detection:

{"id":0,"bypassed":false,"filter":"triggered","classAttrib":"","data_icon":"detector2","name":"Wejscie","strTimeval":""}

This is a state of rest, with no detection of:

{"id":0,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"Wejscie","strTimeval":""}
It is not complete, look to the status subtopic.

In your post of 12 Apr 2021, 13:09 you said:
I tried to replace the whole function read with a message that Domoticz would pick up like in an earlier post, but it didn't work ;-) it would be too simple.
No, indeed , that wil not work.

For the moment try the following.

Create 2 MQTT input modules and configure them as follows:


Screenshot_Risco-Intruderpanel11.png
Screenshot_Risco-Intruderpanel11.png (13.8 KiB) Viewed 1952 times

Configure the first MQTT Input node as follows:

Screenshot_Risco-Intruderpanel12.png
Screenshot_Risco-Intruderpanel12.png (19.3 KiB) Viewed 1952 times

and the second MQTT Input node as follows:

Screenshot_Risco-Intruderpanel13.png
Screenshot_Risco-Intruderpanel13.png (19.81 KiB) Viewed 1952 times
Can you post what you see in both Debug nodes?

And one more question: How many motion detectors do you have installed, which you want to see in Domoticz?

If I have these answers I can create a Function node.

Regards
Last edited by FireWizard on Monday 12 April 2021 19:40, edited 1 time in total.
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

I would need a status for Domoticz for a motion detector from what I looked at domoticz, it is OFF / ON, so in the MQTT 0 or 1 message, I can be wrong. Assign motion detection and no motion detection to the detector in disarmed and armed states.

In the attachment, the NODE-RED log:

http://gtrproject.ddns.net/iot/mqtt3.txt

http://gtrproject.ddns.net/iot/explorer1.jpg
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by FireWizard »

Hello @zabinskiwojciech,

You said:
I would need a status for Domoticz for a motion detector from what I looked at domoticz, it is OFF / ON, so in the MQTT 0 or 1 message,
If you want to use a virtual "Switch" for the motion detection of a motion detector, that is almost correct.
Do you want to use a virtual "Switch"?

But you did not answer several of my previous questions:

1.
Do you agree with that? Is this correct?
Do you agree that we can have 8 different statuses?

2.
I do not know, which values this one can have . It is clear that "active" is one of them, but also "inactive"? Or other value?
Is this the value, where we are looking for? (Active = Alarm?? or Inactive = No Alarm)
3.
How many motion detectors do you have installed, which you want to see in Domoticz?
Do you have 9 detectors and are the id values stable (always the same)?

Regards
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

This is how I want to use a virtual switch - Domoticz has a sub-category for the switch - a motion detector.

ad1. It also comes out that there should be 8 statuses.
ad2. What the mqtt explorer shows, I do not know how to interpret it, because when I look at the logs, nothing changes, even when I trigger the detector and the LED lights up on it.
ad3. Yes, I have 9 sensors installed
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

I try to catch logs from mqtt explorer but only one shows up when the detector is blocked by the application, for example ID1

riscopanel/dects/1
{"id":1,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"Salon","strTimeval":""}
{"id":1,"bypassed":true,"filter":"bypassed","classAttrib":"disable","data_icon":"detector5","name":"Salon","strTimeval":""}
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by FireWizard »

Hello @zabinskiwojciech

I read the source code once more and I believe that the topic riscopanel/dects/<Id_number>/status is not really used.
You did not see it changing either.

So we only use riscopanel/dects/<Id_number>

From all the posts, I have collected the following examples:

Screenshot_Risco-Intruderpanel14.png
Screenshot_Risco-Intruderpanel14.png (41.79 KiB) Viewed 1944 times

The top one shows the normal (quiescent) situation for detector 0.
The middle one shows the same detector in ALARM condition.
The lower one shows detector 11 in DISABLED condition.

I understand you want to use a virtual Switch for alarm.
We can try that, but then we cannot show the disabled condition.

Perhaps a suggestion to create both an Alert Sensor with the following colors:
1. Green for Normal (No alarm and Enabled)
2. Yellow for Disabled
3. Red for Alarm (and Enabled)

And in addition a Switch for Alarm.
You can switch the lights in case of an alarm.

In that case you have to create 9 virtual Alert Sensors and maximum 9 virtual Switches.
If you want to combine let me know.

Regards
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

I'm sitting now and looking at mqtt explorer, changed a bit of settings and managed to catch:

detector in standby mode :
{"id":1,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"Salon","strTimeval":""}
detector in standby mode :
{"id":1,"bypassed":true,"filter":"bypassed","classAttrib":"disable","data_icon":"detector5","name":"Salon","strTimeval":""}
detector in motion detection mode :
{"id":1,"bypassed":false,"filter":"triggered","classAttrib":"","data_icon":"detector2","name":"Salon","strTimeval":""}
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

FireWizard wrote: Monday 12 April 2021 21:55 Hello @zabinskiwojciech

I read the source code once more and I believe that the topic riscopanel/dects/<Id_number>/status is not really used.
You did not see it changing either.

So we only use riscopanel/dects/<Id_number>

From all the posts, I have collected the following examples:


Screenshot_Risco-Intruderpanel14.png


The top one shows the normal (quiescent) situation for detector 0.
The middle one shows the same detector in ALARM condition.
The lower one shows detector 11 in DISABLED condition.

I understand you want to use a virtual Switch for alarm.
We can try that, but then we cannot show the disabled condition.

Perhaps a suggestion to create both an Alert Sensor with the following colors:
1. Green for Normal (No alarm and Enabled)
2. Yellow for Disabled
3. Red for Alarm (and Enabled)

And in addition a Switch for Alarm.
You can switch the lights in case of an alarm.

In that case you have to create 9 virtual Alert Sensors and maximum 9 virtual Switches.
If you want to combine let me know.

Regards
I guess you're right about that warning kettle
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by FireWizard »

Hello @zabinskiwojciech,

I have looked to the details and created a flow (stream) similar to the other two.

You need a virtual Alert Sensor (with a name you prefer) for each Motion Detector (So totally 9)
In addition you need a virtual Switch for each lamp or group of lamps you want to control. (Maximum 9)

The flow is similar to Screenshot_Risco-Intruderpanel9.png in my post of 10 Apr 2021, 18:30

The MQTT Input node has to be configured as follows:
See the picture: Screenshot_Risco-Intruderpanel12.png in my post of 12 Apr 2021, 14:47

The contents of the Function node is now:

Code: Select all

var msg1 = {};
var msg2 = {};

switch (msg.payload.id) {
    
    case 0:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 1:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 2:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;
    
    case 3:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 8:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 9:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 10:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 11:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":14,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":14,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":14,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

    case 12:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":4,"svalue":"ALARM!"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":2,"svalue":"Disabled"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":13,"nvalue":1,"svalue":"Normal"};
        msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "Off" };
    }
    break;

}
return [[msg1,msg2]];
For each detector, you will have to change the IDX number in the line, starting with msg1.payload with the IDX number you have for the Alert Sensor of the corresponding Motion Detector.
Also, you will have to change the IDX number in the line, starting with msg2.payload with the IDX number you have for the Switch, you want to activate if the corresponding Motion Detector is in Alarm.

The MQTT Output node is similar to the others.

Remember. that the message is send by MQTT and is not echoed to MQTT Out in Domoticz by default.
So if you want to use devices (as I saw you use Zigbee2MQTT as well), you might need to configure the setting of "Prevent Loop" to "False"

See:

Screenshot_MQTT loop.png
Screenshot_MQTT loop.png (29.8 KiB) Viewed 1923 times
Let me know, if this is what you want?

Regards
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

Hello, I have slightly modified what you sent so that it would only turn on the Alert sensors.
Nice that it worked, thank you for your help.
It doesn't work as I thought (very long latency) around 15-20 seconds, I could reduce the polling time in risco-mqtt and maybe that would help but I ran into another bug.
The motion detectors I have on the first floor are connected by the expansion module and maybe therefore they do not transmit the alarm state to the cloud. I fired in the node-red MQTT with the theme riscopanel / dects / 12 / #, but it does not find the motion detection status, although the LED on the detector lights up.

shows in logs only :

Code: Select all

13.04.2021, 21:16:52node: 1e473109.8521f7
riscopanel/dects/12 : msg.payload : string[119]
"{"id":12,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"KORYTARZ Pietro","strTimeval":""}"
13.04.2021, 21:16:55node: 1e473109.8521f7riscopanel/dects/12/status : msg.payload : string[6]
"active"
13.04.2021, 21:23:36node: 1e473109.8521f7riscopanel/dects/12 : msg.payload : string[119]
"{"id":12,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"KORYTARZ Pietro","strTimeval":""}"
13.04.2021, 21:23:39node: 1e473109.8521f7riscopanel/dects/12/status : msg.payload : string[6]
"active"
I pasted this into a function in Node-Red

Code: Select all

var msg1 = {};

switch (msg.payload.id) {
    
    case 0:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":315,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":315,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":315,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 1:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":316,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":316,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":316,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 2:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":314,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":314,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":314,"nvalue":1,"svalue":"Normal"};
    }
    break;
    
    case 3:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":317,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":317,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":317,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 8:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":318,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":318,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":318,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 9:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":320,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":320,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":320,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 10:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":321,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":321,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":321,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 11:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":322,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":322,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":322,"nvalue":1,"svalue":"Normal"};
    }
    break;

    case 12:
    if (msg.payload.filter === "triggered") {
        msg1.payload = {"command":"udevice","idx":319,"nvalue":4,"svalue":"ALARM!"};
    } else  if (msg.payload.filter === "bypassed") {
        msg1.payload = {"command":"udevice","idx":319,"nvalue":2,"svalue":"Disabled"};
    } else  if (msg.payload.filter === "") {
        msg1.payload = {"command":"udevice","idx":319,"nvalue":1,"svalue":"Normal"};
    }
    break;

}
return [[msg1]];
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by FireWizard »

hello @zabinskiwojciech,

You wrote:
Hello, I have slightly modified what you sent so that it would only turn on the Alert sensors.
That is quite easy. You can take the following steps:

1. You removed already the lines with: msg2.payload = {"command":"switchlight","idx":15,"switchcmd": "On" };

2. You can also remove:
var msg1 = {};
var msg2 = {};

But in that case you should change all lines starting with msg1.payload = into msg.payload =

3. The last line you can then change into: return msg;

Otherwise leave it as it is now.
It doesn't work as I thought (very long latency) around 15-20 seconds, I could reduce the polling time in risco-mqtt and maybe that would help but I ran into another bug.
The motion detectors I have on the first floor are connected by the expansion module and maybe therefore they do not transmit the alarm state to the cloud. I fired in the node-red MQTT with the theme riscopanel / dects / 12 / #, but it does not find the motion detection status, although the LED on the detector lights up.
I see that you have spaces in: riscopanel / dects / 12 / #. That is not correct. Remove them in your MQTT Input node.

I do not think I can help you further with this problem. I see also in your log file that "triggered" is missing.

Perhaps to contact the supplier or manufacturer is a solution, but I do not know if they will respond.

Is there anything else, you want (eventhistory in a text file?)

Best regards
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

The space character is missing in my MQTT receiver crept in when I copy and paste.
I have sent the log so that you can see if I'm looking for it well.
Thank you very much for your help with the topic.
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

FireWizard wrote: Tuesday 13 April 2021 15:02 Hello @zabinskiwojciech,



Remember. that the message is send by MQTT and is not echoed to MQTT Out in Domoticz by default.
So if you want to use devices (as I saw you use Zigbee2MQTT as well), you might need to configure the setting of "Prevent Loop" to "False"

See:


Screenshot_MQTT loop.png

Let me know, if this is what you want?

Regards
could be useful to prevent problems
db77
Posts: 6
Joined: Saturday 30 October 2021 16:11
Target OS: Windows
Domoticz version:
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by db77 »

Hello,
I'm french, so, sorry for my bad english.
Iuse a Risco system but since few months I'm unable to use the Android software because it need a payment.
So, I search to create my own software to access to the commands of this systeme Risco.
I found SMS commands but I have tried to send SMS with Android Studio unsuccessed.
So, I search and search and search... the http commands, get, post, and also, port and protocol to send and receive data from the risco system.
And I find this forum.
But I don't have "Domoticz" and I don't know what it is...
Can you help me ?
I search to send command from my Android phone to the risco system and get the result data on my phone Android.... because when I'm in holidays, I want to access to the system. Recently, my system sound but I don't reveive SMS and my neightbours say me that it sound... Theree were many wind and the sensors was activated and alarm also...
Thanks in advance
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

Hello. I use FreeCo trol on android and I pay nothing for free. Domoticz helps me with the automation of my home, e.g. turning on the light when it detects movement from an alarm detector.
db77
Posts: 6
Joined: Saturday 30 October 2021 16:11
Target OS: Windows
Domoticz version:
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by db77 »

zabinskiwojciech wrote: Saturday 30 October 2021 17:54 Hello. I use FreeCo trol on android and I pay nothing for free. Domoticz helps me with the automation of my home, e.g. turning on the light when it detects movement from an alarm detector.
Hello,
Thanks for your answer.
I don't know FreeControl but I donwload it from PlayStore and I try it...
It say (in french because I'm french and my screen is in french but you can use Google translate) :
====================
ABONNEMENT CLOUD
Ces services interactifs sont devenus payants.
Pour continuer à profiter des fonctionnalités et bénéfices de ces services, qui incluent l'utilisation de l'application Smartphone, veuillez vous abonner.
Le paiement sera implémenté directement via votre compte dans Play Store.
S'abonner maintenant
====================
So same result for me...
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by FireWizard »

Hello @db77 and @zabinskiwojciech,

@zabinskiwojciech wrote:
I use FreeControl on android and I pay nothing
and @db77 wrote
I use a Risco system but since few months I'm unable to use the Android software because it need a payment.
If you go to: https://play.google.com/store/apps/deta ... l=nl&gl=US, I can tell you, that the comments in Dutch are far from friendly. @zabinskiwojciech is probably lucky, that he still can use the mobile app for free, But if that will last forever, I doubt?
I fully agree with them, because at the time of buying the intrusion alarm system, the mobile app was free. And then suddenly, you have to pay 24 Euro per year, while you get nothing extra. This doesn't sound nice and future customers should seriously take this into account.

@db77
But I don't have "Domoticz" and I don't know what it is...
For what you need, Domoticz is not required. As said by @zabinskiwojciech, it might be used to execute some controls, such as to switch on the lights, switch on a siren, to send a notification, etc. But all these things can be done without Domoticz.

As you can read in this thread, the Risco alarm panel is able to send data with MQTT. If you want to use MQTT, you will need a MQTT server (broker).
Mosquitto is the preferred one. See: https://mosquitto.org/

To convert messages from you Risco panel you need in addition another tool. In this case Node-Red. See: https://nodered.org/
This tool we used also for converting the messages to/from Risco to/from Domoticz.

But you need an operator panel.
I suggest you should have a look at: https://github.com/thanksmister/android ... larm-panel

As far as I have seen the screenshots from FreeControl, the MQTT Alarm panel can fully replace it.

I use it in co-operation with Node-Red, of course MQTT and object recognition from IP camera's.
It works fine.

Required:
1. Hardware, such as a Raspberry Pi.
2. Mosquitto, installed on that hardware.
3. Node Red installed on that hardware.
4. risco-mqtt-bridge on that device (See: https://github.com/lucacalcaterra/risco-mqtt-bridge)
5. Android device
6. Time to design your system, time to program/configure and time to test.

Together with @zabinskiwojciech, we needed a week to develop the solution, but for the MQTT alarm panel, I have a flow ready.

Let me know your thoughts.

Regards
Last edited by FireWizard on Sunday 31 October 2021 13:50, edited 2 times in total.
zabinskiwojciech
Posts: 79
Joined: Thursday 16 May 2019 16:23
Target OS: Linux
Domoticz version: 4.10776
Location: Warszawa
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

when I have to pay for the application, I will definitely give up on it, which is a pity because it is often useful to me.
db77
Posts: 6
Joined: Saturday 30 October 2021 16:11
Target OS: Windows
Domoticz version:
Contact:

Re: Risco Lightsys alarm system - Domoticz

Post by db77 »

FireWizard wrote: Saturday 30 October 2021 19:22 If you go to: https://play.google.com/store/apps/deta ... l=nl&gl=US, I can tell you, that the comments in Dutch are far from friendly. @zabinskiwojciech is probably lucky, that he still can use the mobile app for free, But if that will last forever, I doubt?
I fully agree with them, because at the time of buying the intrusion alarm system, the mobile app was free. And then suddenly, you have to pay 24 Euro per year, while you get nothing extra. This doesn't sound nice and future customers should seriously take this into account.
This is this software I tried and the message I post here.
I use for the beginning, iRisco but since few months we must paid and many users and installers are not very happy...
I can post link here (Google translate these) :
https://forum.quechoisir.org/alarme-ris ... 99278.html
I've tried all the software in Play Store, FreeControl, Free4Control, HandyApp, Blue Alarm, Stanley Safe... Nothing works without paiement for Cloud.
As you can read in this thread, the Risco alarm panel is able to send data with MQTT. If you want to use MQTT, you will need a MQTT server (broker).
Mosquitto is the preferred one. See: https://mosquitto.org/
I have install MQTT on my PC and MQT Explorer but I don't use with succes.
I suggest you should have a look at: https://github.com/thanksmister/android ... larm-panel
As far as I have seen the screenshots from FreeControl, the MQTT Alarm panel can fully replace it.
Without Cloud payment ? Maybe an error made by the installer ?
Required:
1. Hardware, such as a Raspberry Pi.
2. Mosquitto, installed on that hardware.
3. Node Red installed on that hardware.
4. Android device
5. Time to design your system, time to program/configure and time to test.

Together with @zabinskiwojciech, we needed a week to develop the solution, but for the MQTT alarm panel, I have a flow ready.

Let me know your thoughts.

Regards
I don't have Raspberry PI, only windows and android, but I need android when I'm in holidays for example
I have install mosquito and node.js on my PC
I have not install node red
When I launch MQT Explorer, I don't knwo what to do, URL ? and other parameters

I know SMS commands, for example PIN+A = set on alarm, PIN+D=set off alarm, PIN+ST=get status
Is it possible to send same command by http ?
For example protocol://adresse-IP:port?var=string
and if it is possible, how to get data from system ?

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests