@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 (13.8 KiB) Viewed 1952 times
Configure the first MQTT Input node as follows:
- Screenshot_Risco-Intruderpanel12.png (19.3 KiB) Viewed 1952 times
and the second MQTT Input node as follows:
- 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