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:

Risco Lightsys alarm system - Domoticz

Post by zabinskiwojciech »

Hello all
I have a Risco Lightsys alarm system with an IP module installed at home.
The module is now connected to the risco cloud, somehow it works, but is there anyone who connected this alarm system to the domoticz?
There is a way https://github.com/lucacalcaterra/risco-mqtt-bridge to connect to Home Assistant but I haven't found anything about cooperation with Domoticz.
User avatar
FireWizard
Posts: 1893
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 »

Hi,

You wrote:
Hello all
I have a Risco Lightsys alarm system with an IP module installed at home.
The module is now connected to the risco cloud, somehow it works, but is there anyone who connected this alarm system to the domoticz?
There is a way https://github.com/lucacalcaterra/risco-mqtt-bridge to connect to Home Assistant but I haven't found anything about cooperation with Domoticz.
If you go to the provided link on Github, you will find:
This application is useful for interfacing a home automation controller that support MQTT protocol (for example Openhab, Home Assistant, etc... ) with Cloud Risco (or MyElas, depending on your country).

It can receive information from the Cloud Risco and send it to an MQTT server, or then receive commands via MQTT messages to be sent to the Cloud Risco(for example to arm or disarm your system).
This is an interface between your cloud service and any Home Automation system, which supports MQTT. Domoticz supports MQTT, so it should not be too difficult.

Beside that you need a full functioning Domoticz, you need a MQTT server (Mosquitto, NodeJS and Node Red)

You have to install NodeJS. Currently the LTS versions is version 12.18.4. You can either install this versions or the latest 14.11.0.
See: https://nodejs.org/en/ and https://nodejs.org/en/download/package-manager/

Next you will need Mosquitto.
See: https://mosquitto.org/download/

As the published cloud messages, cannot be read by Domoticz, they have to be converted. Node Red is used for that.
See: https://nodered.org/docs/getting-started/local

The scripts will also install NodeJS, so no need to install it seperately.

If you decide to choose this solution, I'm happy to give some support, if needed. But I do not own such a unit.

Regards
Last edited by FireWizard on Wednesday 07 April 2021 9:13, 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 »

Hello, maybe someone has an easy solution to start a Risco cloud connection with Domoticz. Now I use Home Assistant to control the alarm but I cannot use PIR detectors, e.g. to turn on the light, because I have all the automation on Domoticz. I am not a programming specialist :-)
User avatar
FireWizard
Posts: 1893
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

As it is already some time ago, that you raised more or less a similar question, I recommend to follow the procedure in my previous post.

1. Install the Mosquitto broker.

If you are on a Raspberry Pi, you can use:

Code: Select all

sudo apt install mosquitto
and

Code: Select all

sudo apt install mosquitto-clients
It will install the latest version, available in the Raspberry Pi OS repository (version 1.5.7-1+deb10u1)

For any other OS follow the link:

https://mosquitto.org/download/

Current version is 2.0.10.

2. Install NodeJS, unless you want to install it on a Raspberry Pi. Follow in this case: https://nodered.org/docs/getting-started/raspberrypi

https://nodejs.org/en/download/package-manager/

3. Install Node Red (Skip this step if you use the script for Raspberry Pi).

https://nodered.org/docs/getting-started/local

4. Test if everything is nicely playing together.

5. Configure in Domoticz under "Setup" > "Hardware", "MQTT Client Gateway with LAN interface" and check that Domoticz is able to communicate with the Mosquitto broker.

6. Install the risco-mqtt-bridge

https://github.com/lucacalcaterra/risco-mqtt-bridge

7. Install on laptop/desktop PC or a device you use to browse to Domoticz a MQTT client, so that you can see all incoming messages on the broker.

Recommended client: http://mqtt-explorer.com/

If you need more info or support, just ask.

Regards
Last edited by FireWizard on Saturday 10 April 2021 18:34, 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 »

Hello ;-)
You inspired me and I installed all the modules you gave and I think everything works because the "riscopanel" entries appeared in MQTT Explorer, but what now I would have to do. I added node-red and the risco-mqtt-bridge script to pm2 and they start automatically after rebooting.
I don't really understand node-red ;-)
Thank you for your help and understanding.
User avatar
FireWizard
Posts: 1893
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:
You inspired me and I installed all the modules you gave and I think everything works because the "riscopanel" entries appeared in MQTT Explorer,
That looks good, so we can take the next steps.
I added node-red and the risco-mqtt-bridge script to pm2 and they start automatically after rebooting.
Perfect.
but what now I would have to do? I don't really understand node-red
I do remember that from a couple of years ago and that will not last long ;)

As you mentioned you receive data from the Risco cloud by MQTT and to MQTT Explorer.

Can you post a screenshot (or more, if you think it is useful) of what you get in MQTT Explorer.

As you can see at https://github.com/lucacalcaterra/risco-mqtt-bridge, several topics are received.
Which topics do you want to have shown in Domoticz?
Do you also want to send commands to the Risco Panel, such as ARM/DISARM?

For now I recommend to read the Node Red "Getting Started" See: https://nodered.org/docs/user-guide/

What you can do is already the following:

Drag and drop a MQTT input node from the library (at the left) to the canvas.
Drag and drop a "Debug" node to the canvas and connect the output of the MQTT input node to the input of the "Debug" node.
See:

Screenshot_Risco-Intruderpanel1.png
Screenshot_Risco-Intruderpanel1.png (7.13 KiB) Viewed 3316 times
Configure the MQTT input by "double click on the node", as follows:

Screenshot_Risco-Intruderpanel2.png
Screenshot_Risco-Intruderpanel2.png (19.32 KiB) Viewed 3316 times

Click on the pencil right beside the "Server" field.

The following configuration window opens:

Screenshot_Risco-Intruderpanel3.png
Screenshot_Risco-Intruderpanel3.png (29.7 KiB) Viewed 3316 times
For "Server", you should take the IP address of the device, on which Mosquitto has been installed.
If it is the same device as where Node Red has been installed, you can take 127.0.0.1 or "localhost" (without " ")
Give the server a name. You have to do this only once.
The rest you can leave as indicated in the screenshot.
I assume you did not set a username/password for Mosquitto, yet.

Now you return to the first window.

Fill in the fields as shown on the screenshot.

Subscribing to topic riscopanel/# will show all topics related to the Risco panel.

You can see these appearing in the Debug pane at the right, using control-g d or clicking on the small bug, at the top right.

If everything is correctly configured you should see coming in the data from the Risco Panel as well.

Let me know and a screenshot is very nice.

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 an image from Risco itself from Mqtt Explorer. I still have a topic from the alarmpanel but I don't know if it is from the Risco cloud. To begin with, I would like to read the status from the detectors and maybe let's focus on this.
Image
If something more is needed, write.
Thank you for your interest and help.
Attachments
risco_1.jpg
risco_1.jpg (202.34 KiB) Viewed 3306 times
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 »

Debugging works


{"id":11,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"POK.3 Pietro","strTimeval":""}

{"id":12,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"KORYTARZ Pietro","strTimeval":""}

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

{"id":1,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"Salon","strTimeval":""}
User avatar
FireWizard
Posts: 1893
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 still have a topic from the alarmpanel but I don't know if it is from the Risco cloud.
Do you mean that you had this message alarmpanel/sensor already before you added riscopanel/#?

This message comes from an app called MQTT Alarmpanel.
See: https://github.com/thanksmister/android ... larm-panel

This an app intended to be used as a mobile "Alarm panel"
See the README file in the link above and then the chapter "MQTT Sensor and State Data".

Do you recognize to have this app installed on some device?
(I use this app together with Domoticz and have the same published topic in Mosquitto)

But the risco-mqtt-bridge is also intended to co-operate with Home Assistant en its Alarm panel.
So it may very well be introduced by them as well.
But nothing to worry about.

I studied the README of the risco-mqtt-bridge and also the source code and found the following:

1. I see a number of 5 subtopics:
MAINCHAN: 'riscopanel', // Main Topic
ARMSTATUS: 'armstatus', // Arm status subtopic
DETECTORS: 'dects', // Detectors subtopic
EVENTHISTORY: 'eventhistory', // Event History subtopic
ISONALARM: 'isonalarm', // Topic for receiving ongoing alarm

2. If we look to the riscopanel/armstatus, I found that we can receive the following data:

ARMED: 'armed',
PARTARMED: 'partarmed',
DISARMED: 'disarmed',

In Domoticz we use Arm Away, Arm Home and Disarmed.

Do you want to have these statuses displayed in Domoticz and if so which Sensor Type (Security Panel? or a Text Sensor)

Do you also want to set these different statuses from Domoticz? Possible with Security Panel?

3. If we look to the riscopanel/dects, I am less sure.

I see things like bypass and unbypass. What do they mean with respect to the detector?
Is bypass equal to ACTIVE, ON or ARMED? So if the detector shows bypass, does that mean it will detect an event?
Can you test? Or is it the other way around and will unbypass detect an event?

I think it is equal to ENABLE and DISABLE
In this case I suggest to use a virtual switch.
Is each detector capable of indicating an individual alarm?
I see you have 13 ID´s, but only 9 detectors. Are you missing some?

4. The next topic, we can subscribe to, is riscopanel/isonalarm
This is just a boolean value (true/false)
You can use a virtual switch for that, which can activate the desired actions, such as:
- Switching the lights
- Send an email or other notification
- Trigger a sound alarm
- Send a message to Google

5. Subscribing to riscopanel/eventhistory will give you e.g the possibility to send a message to a Text sensor (last alarm or last error)

Is there anything else, you want to send to Domoticz?

I made a simulation of the detector data, you send in the previous post.

A lot of data is empty, as you have seen.

Screenshot_Risco-Intruderpanel4.png
Screenshot_Risco-Intruderpanel4.png (24.82 KiB) Viewed 3290 times
In the MQTT input node, I have configured the Output as "a parsed JSON object"
And it is better to send a screenshot, like above, instead of all the text in your last post.

If you need to send code, it is more readable to send it between < />, like

Code: Select all

{"id":11,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"POK.3 Pietro","strTimeval":""}

{"id":12,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"KORYTARZ Pietro","strTimeval":""}

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

{"id":1,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"Salon","strTimeval":""}
This is easier to read.

If you can answer the questions raised, I will be able to make a flow.
You can already start to create your virtual devices.

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 tried to create something but it doesn't really work
This is my project

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

And such logs show.
http://gtrproject.ddns.net/iot/logi.txt
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 like to receive from the alarm:

1: status of all detectors - how to detect motion to trigger a virtual switch (there are motion sensors in Domoticz) if it is impossible, they can be switches

2: alarm status - armed, disarmed, partarmed


In general, I want to use the detector status to switch on the light, but I will do it in blockly, and the alarm status is best in text form.
Those detectors that are not there will not be because they are not activated.
User avatar
FireWizard
Posts: 1893
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 would like to discuss your post of 23:14 first.

You said:
Hello, I tried to create something but it doesn't really work
I disagree with "it doesn´t really work". It is an important step, that you took the initiative to create something yourself, but you met a particular obstacle, which I will explain below.

The first Node, you used was a MQTT input node. The topic you configured was: "riscopanel/#". Exactly the same I used in my example.
The "#" is a wildcard, which means that all subtopics under riscopanel are accepted and send to the next node.

Now we have to return to your picture of the output in MQTT Explorer. And there you will see the obstacle, causing all the error messages.

If you look to all the subtopics published under the topic "riscopanel", you will see:

1. "armstatus". This armstatus can have 3 values (as I read in the README file): "disarmed ", partarmed and armed. (See also my post 18:12h)
These status will be send as a string value.

2. "isonalarm". This is a boolean value, which can only have the values true or false. It will be send as a string value, but can be transformed to a boolean.

3. "dects". This is a more complex object. I do not have a complete overview of it as the arrows before the numbers are "closed".
Could you click on the arrow and send me a new screenshot of that part.

4. "eventhistory". This is an array, but also with another subtopic (today).

So almost everything is present and all these topics have to be handled different, and that is the obstacle you met.
The JSON node cannot handle the string (disarmed and others) and therefore you got all the error messages "Unexpected token a in JSON at position 0",
because there are a lot of strings.

In the debug node you can read, what kind of value it is. (string, number, array, etc.)

Another Question.

There are several other questions not answered in my previous post. Can you do that?

In my next post I will present some working examples, that you can accept or modify.

Regards
User avatar
FireWizard
Posts: 1893
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,

In this post I will explain, how you can send the "armstatus" to Domoticz, as you said:
the alarm status is best in text form

I start with (your second wish)
2: alarm status - armed, disarmed, partarmed
As said in my previous post, that all topics requires a different procedure, I have split up the different topics.
So I cannot use the wildcard # and so I modified the MQTT Input node:

Screenshot_Risco-Intruderpanel5.png
Screenshot_Risco-Intruderpanel5.png (19.67 KiB) Viewed 3263 times
The topic is now "riscopanel/armstatus". If you connect a Debug node to that MQTT input node, you will see, that you receive strings.

The next step is to find the right syntax of the message to Domoticz.
You can find that at: https://www.domoticz.com/wiki/Domoticz_ ... ext_sensor

I like this site also: https://piandmore.wordpress.com/2019/02 ... -domoticz/

It is stated for the Text Sensor:
Text

The text sensor will show any text you want.

{"command":"udevice", "idx":1234, "svalue":"any text"}
So I created a virtual "Text" sensor in Domoticz. In my case it has got IDX = 11, but you have to change that.

I use always a "Function" node to convert the value.

In the most simple form this looks as follows:

Code: Select all

msg.payload = {"command":"udevice", "idx":11, "svalue":msg.payload}
return msg;
But probably you are not satisfied with the simple texts as "disarmed", "partarmed" or "armed" and want have different texts or translated texts to Polish.

You can change the "Function" node as follows:

Code: Select all

switch (msg.payload) {
    
    case "disarmed":
    msg.payload = {"command":"udevice","idx":11,"svalue":"Disarmed"};
    break;

    case "partarmed":
    msg.payload = {"command":"udevice","idx":11,"svalue":"Armed Home"};
    break;

    case "armed":
    msg.payload = {"command":"udevice","idx":11,"svalue":"Armed Away"};
    break;
}
return msg;
Personally I prefer the "switch/case" statement, but you can also use "If ..... then ..... else" statements to achieve the same goal.

Your flow looks as follows (with right the "Debug" pane)

Screenshot_Risco-Intruderpanel6.png
Screenshot_Risco-Intruderpanel6.png (78.87 KiB) Viewed 3263 times
From the top to the bottom, you see at the right 3 times the output of the MQTT Input node.
Mind at the top of each message: "riscopanel/armstatus : msg.payload : string[8]".
You see the topic and you see also that msg.payload is a string.

Next you see the output directly from the payload send to the "Text" sensor in Domoticz.

And the last three messages shows the result after translation.

In Domoticz you will see:

Screenshot_Risco-Intruderpanel7.png
Screenshot_Risco-Intruderpanel7.png (39.22 KiB) Viewed 3263 times
I would suggest you try it and test if this is what you want.
Do not forget to change the IDX number and eventually the text in the "Function" node.

Regards
User avatar
FireWizard
Posts: 1893
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,

In this post I will show an example, on what you can do with the topic "isonalarm".

In fact the status of this topic is sent as a string, which can have two values: "false" or "true"
This is a boolean and can easily converted to JSON.

In order to collect the data, we configure a separate MQTT Input node and configure it as follows:

Screenshot_Risco-Intruderpanel8.png
Screenshot_Risco-Intruderpanel8.png (34.13 KiB) Viewed 3259 times

You will see, that we don´t use any wildcard notation in the Topic field. We have as Topic "riscopanel/isonalarm", which can only be "false" of "true".
As Output we take a parsed JSON object.
The result of that, you see at the right. Mind: "riscopanel/isonalarm : msg.payload : boolean"

As an alarm is a a serious event, I have selected as virtual sensor the "Alert" sensor.

The requirements for an Alert Sensor are:
Alert

The alert sensor will show you a message and an alert level.

{"command":"udevice", "idx":1234, "svalue":"any text", "nvalue":lvl}

where level can be any of the following:

0 off, grey
1 ok, green
2 yellow, level 1 warning
3 orange, level 2 warning
4 red, level 3 warning
For the non-alarm condition, we take the level 1 (green) and text "Normal", while for the alarm condition we take warning level 3 (Red) and text "ALARM!"

For the "Function" node this will result in the following contents:

Code: Select all

if (msg.payload === false) {
    msg.payload = {"command":"udevice","idx":12,"nvalue":1,"svalue":"Normal"};
} else  if (msg.payload === true) {
    msg.payload = {"command":"udevice","idx":12,"nvalue":4,"svalue":"ALARM!"};
}
return msg;
This will result in the following output:

Screenshot_Risco-Intruderpanel9.png
Screenshot_Risco-Intruderpanel9.png (56.82 KiB) Viewed 3259 times

You will also see the previous example (alarmstatus) and in Domoticz these 2 looks like:

Screenshot_Risco-Intruderpanel10.png
Screenshot_Risco-Intruderpanel10.png (76.58 KiB) Viewed 3259 times

In principle the 2 MQTT Output Nodes can be combined into 1, but that is not important.

The next stream, we have to configure is the "dects" topic, but therefore I need additional info.

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 »

Today I did not have time to sit down to the topic, but I returned to your earlier question and when I blocked the detector in the system so that the alarm would not be used during arming, it entered the mode:

{"id":11,"bypassed":true,"filter":"bypassed","classAttrib":"disable","data_icon":"detector5","name":"POK.3 Pietro","strTimeval":""}


How I unlock it in the system changes as before and in MQTT Explorer it shows:

{"id":11,"bypassed":false,"filter":"","classAttrib":"","data_icon":"detector","name":"POK.3 Pietro","strTimeval":""}

I haven't tested anything yet, but when I get enough sleep, I start testing.
Thank you and best regards.
User avatar
FireWizard
Posts: 1893
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,

Today I will not be at home, either.
So I will not be able to look to the flow and your answers.

We will continue tomorrow.

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 »

FireWizard wrote: Saturday 10 April 2021 16:08 Hello @zabinskiwojciech.

I would like to discuss your post of 23:14 first.

You said:
Hello, I tried to create something but it doesn't really work
I disagree with "it doesn´t really work". It is an important step, that you took the initiative to create something yourself, but you met a particular obstacle, which I will explain below.

The first Node, you used was a MQTT input node. The topic you configured was: "riscopanel/#". Exactly the same I used in my example.
The "#" is a wildcard, which means that all subtopics under riscopanel are accepted and send to the next node.

Now we have to return to your picture of the output in MQTT Explorer. And there you will see the obstacle, causing all the error messages.

If you look to all the subtopics published under the topic "riscopanel", you will see:

1. "armstatus". This armstatus can have 3 values (as I read in the README file): "disarmed ", partarmed and armed. (See also my post 18:12h)
These status will be send as a string value.

2. "isonalarm". This is a boolean value, which can only have the values true or false. It will be send as a string value, but can be transformed to a boolean.

3. "dects". This is a more complex object. I do not have a complete overview of it as the arrows before the numbers are "closed".
Could you click on the arrow and send me a new screenshot of that part.

4. "eventhistory". This is an array, but also with another subtopic (today).

So almost everything is present and all these topics have to be handled different, and that is the obstacle you met.
The JSON node cannot handle the string (disarmed and others) and therefore you got all the error messages "Unexpected token a in JSON at position 0",
because there are a lot of strings.

In the debug node you can read, what kind of value it is. (string, number, array, etc.)

Another Question.

There are several other questions not answered in my previous post. Can you do that?

In my next post I will present some working examples, that you can accept or modify.

Regards
It worked right away, the status is changing ;-)
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: Saturday 10 April 2021 18:30 Hello @zabinskiwojciech,

In this post I will show an example, on what you can do with the topic "isonalarm".

In fact the status of this topic is sent as a string, which can have two values: "false" or "true"
This is a boolean and can easily converted to JSON.

In order to collect the data, we configure a separate MQTT Input node and configure it as follows:


Screenshot_Risco-Intruderpanel8.png


You will see, that we don´t use any wildcard notation in the Topic field. We have as Topic "riscopanel/isonalarm", which can only be "false" of "true".
As Output we take a parsed JSON object.
The result of that, you see at the right. Mind: "riscopanel/isonalarm : msg.payload : boolean"

As an alarm is a a serious event, I have selected as virtual sensor the "Alert" sensor.

The requirements for an Alert Sensor are:
Alert

The alert sensor will show you a message and an alert level.

{"command":"udevice", "idx":1234, "svalue":"any text", "nvalue":lvl}

where level can be any of the following:

0 off, grey
1 ok, green
2 yellow, level 1 warning
3 orange, level 2 warning
4 red, level 3 warning
For the non-alarm condition, we take the level 1 (green) and text "Normal", while for the alarm condition we take warning level 3 (Red) and text "ALARM!"

For the "Function" node this will result in the following contents:

Code: Select all

if (msg.payload === false) {
    msg.payload = {"command":"udevice","idx":12,"nvalue":1,"svalue":"Normal"};
} else  if (msg.payload === true) {
    msg.payload = {"command":"udevice","idx":12,"nvalue":4,"svalue":"ALARM!"};
}
return msg;
This will result in the following output:


Screenshot_Risco-Intruderpanel9.png


You will also see the previous example (alarmstatus) and in Domoticz these 2 looks like:


Screenshot_Risco-Intruderpanel10.png


In principle the 2 MQTT Output Nodes can be combined into 1, but that is not important.

The next stream, we have to configure is the "dects" topic, but therefore I need additional info.

Regards
You are great. Both functions from status work ;-)
Thanks

In the dect function for motion sensors
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.
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 »

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.
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 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":""}
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests