More Kerui fun, smoke detectors almost working + FOB almost as well

Trying to integrate a China alarm deeper to the Vera has given some interesting insights, and possibly some hope that it will be doable. This relates to some extent to the thread: KERUI Siren integration - - USB RFXtrx Transceiver - Ezlo Community where the Kerui Siren + FOB (remote) is discussed.

First of all I have Kerui smoke detectors. They actually register in Vera but as door sensors. This is not a big deal, except that when they trigger, they trigger for Burglary instead of Fire, which is not really good.

I think that with some guidance, I could easily change this myself in the plug-in, in a similar way done earlier with Kerui motion sensors.

Each smoke detector creates two devices: RFX Door D/F871A and
RFX Door D/F871A 2 (not sure why). It seems only one of them is the actual smoke detector, the other one is probably created by some response code sent.

They are detected as device altid: DS/D/F871A

Looking in the logs lots of things are going on when the smoke detector triggers, I receive at least the following looking in the Lua log:
09 13 00 54 F8 71 A9 01 4B 50
09 13 00 55 F8 71 A9 01 4A 50
09 13 00 53 F8 71 A9 01 4C 50
09 13 00 59 F8 71 A9 01 4A 60
09 13 00 5A F8 71 A9 01 4C 60
09 13 00 5B F8 71 A9 01 4B 60
09 13 00 61 F8 71 A9 01 4A 40

Looking in RFXmgr backs this story up, one trigger of the smoke detector receives the following packets:

2019-07-26 03:49:44:977
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 31
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 329 usec
Signal level = 3 -96dBm

2019-07-26 03:49:45:097
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 32
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 331 usec
Signal level = 4 -88dBm

2019-07-26 03:49:45:216
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 33
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 328 usec
Signal level = 4 -88dBm

2019-07-26 03:49:45:336
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 34
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 329 usec
Signal level = 4 -88dBm

2019-07-26 03:49:45:467
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 35
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 331 usec
Signal level = 3 -96dBm

2019-07-26 03:49:45:601
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 36
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 329 usec
Signal level = 4 -88dBm

2019-07-26 03:49:45:747
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 37
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 330 usec
Signal level = 3 -96dBm

2019-07-26 03:49:45:892
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 38
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 329 usec
Signal level = 4 -88dBm

2019-07-26 03:49:46:039
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 39
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 330 usec
Signal level = 3 -96dBm

2019-07-26 03:49:46:169
Packettype = Lighting4
subtype = PT2262
Sequence nbr = 40
Code = F871A9 decimal:16282025
S1- S24 = 1111 1000 0111 0001 1010 1001
Pulse = 329 usec
Signal level = 3 -96dBm

What would be needed to make this detected as a smoke detector?

Secondly, I tried som stuff with the Kerui FOB (it would be super nice to be able to interact with the Kerui Alarm from Vera and vice versa).

Remote FOB creates for arm/disarm:
Binary switches:
LS/L5.2/0746E6/06
LS/L5.2/0746E6/05

Interestingly enough, for home arm it creates:
RFX Remote:
RC/L5.2/0746E6

where “Bright” works as “Home arm”
Interesting behaviour is that when turning on the switch nothing happens, but turning it off emulates the button press of the FOB.

The logs from RFXmgr looks like this:
Arm:
2019-07-26 03:52:37:617
Packettype = Lighting5
subtype = BBSB new
Sequence nbr = 51
ID = 0746E6 decimal:476902
Unit = 6
Command = Off
Signal level = 3 -96dBm

Disarm:
2019-07-26 03:58:53:112
Packettype = Lighting5
subtype = BBSB new
Sequence nbr = 121
ID = 0746E6 decimal:476902
Unit = 5
Command = Off
Signal level = 4 -88dBm

I don’t get why “Arm”, “Disarm” and “Home arm” behaves differently from the Vera perspective, but it would be super nice to have this detected as a “Security remote” rather than three different objects with a bit strange behavior. Again, if pointed in the right direction, I could possibly implement this myself, but I would need some guidance from someone more experienced with the code.

(Hoping for some comments here from @tinman maybe. :wink:

This would together with the motion sensor already working, be a good integration for the Kerui Alarm panel + devices, this is probably one of the most common chinese alarms, so it would kind of make sense. Also it makes it possible to trigger the Kerui alarm from Vera to send custom sms and make phone calls for actions initiated in Vera which really adds some value.

A couple of points here:

  1. Lighting4 and Lighting5 are two different protocols. I don’t think there is any way that the FOB could ever trigger the siren directly. I think there will be ways to have it do so through the Vera hub.
  2. Since there are door sensors, smoke sensors, and motion sensors that are all implemented using the same devices internally there is no way that the auto-create function of the RFXtrx plugin can always automatically create the proper device. The plugin already has the means to convert between similar devices. But currently it does not properly handle these sensor devices. I’ll be working on fixing this.

Absolutely correct. I wasn’t clear: There is a Kerui Alarm Panel inbetween. Strangely enough the sensors for the alarm communicate with Lighting4, and the FOB with Lighting5. The panel seems happy with both. So the thing here would be to 1: Emulate the FOB as a security remote in Vera, to control the alarm panel from Vera. 2: Use the physical FOB to trigger actions in Vera.

I get it, it is not easy for the code to know what is what here. But since it was done in a very nice way for the motion sensor (showing up as a motion sensor in Vera) I kind of expect the exact same fix will be applicable for the smoke sensor, right?

And again: if you want, pleasepoint me to the “hack” for the Kerui motion sensor in the code, and I’m happy to develop try to do the fix myself. Would be really nice to be able to contribute.

I don’t know this plugin in details, but you can easily change a device type file. Go to device details, then advanced and set category to 4 and subcategory to 4. Then hard refresh your browser. See http://wiki.micasaverde.com/index.php/Luup_Device_Categories

OK! This could actually do the trick for the sensor, I’ll try it. I doubt that it will fix the security remote though, since it is three devices, but should be one.

OK, so I tried the subcategory thing. This solved it partially, but then I also changed the device_type to urn:schemas-micasaverde-com:device:SmokeSensor:1 and the device_json file to D_SmokeSensor1.json.

This together seem to have done the trick for the smoke detector, making it behave like I want, triggering fire, not burglary and having the right icon.

Now the only question is, is this a sustainable setup, or did I possibly break something by using this hybrid config? What’s your experience?

Your changes should not break anything. I’ve been working on making code changes to the existing way of changing a device type found in the plugin’s managed devices tab. Users should not have to tweak device properties to get it act like the type it is. The existing code doesn’t make it easy for these types of sensors. Along the way I’ve been modifying the code to improve readability and performance. In the next version Internet Explorer will no longer be supported.

Yeah, I’m so used to fiddle with device files as well, that I forgot to mention them. I usually change them to reflect the real use case, even for supported sensors. It won’t hurt.

An error in a device type, specifically, is one way you can get Luup to not restart. It will mostly work (i.e. everything but the modified device will work; the modified device still won’t behave) until you reload Luup, but then, Luup sometimes won’t start at all. And that’s pretty hard to fix unless you have Luup running (which it won’t).

Always back up your Vera before making any manual device type changes.

1 Like

Hi
Please how to add kerui smoke detector to Vera plus ? Thanks

Every device has a unique ID. It’s part of the messages it transmits. If the smoke detector is the only device you have then there are a couple of things you can try:

  • Set the RFXtrx to auto-create devices and then trigger the smoke detector. You’ll probably need to trigger it more than once. Look for a door sensor device to be created. You can then convert this door sensor to a smoke sensor.
  • Connect your RFXtrx to your PC and use the RFXMngr program. As before you’ll need to trigger the smoke detector. Look for Lighting4 packets to appear. Once you are convinced that you’ve captured packets from your smoke sensor you can use the packet information to create a smoke sensor device. When you have the RFXtrx again connected to your Vera Plus you can go to the Apps tab → Develop apps and select Create Device. Device Type should be urn:schemas-micasaverde-com:device:SmokeSensor:1. Internal ID should be SS/D/nnnnn where nnnnn is the first 5 hex digits of the Code value seen in the RFXmngr data. The UPNP device filename should be D_SmokeSensor1.xml. Select a room if you like and from the Parent Device dropdown select your RFXtrx. Click Create Device. You’ll need to have the Vera do an Luup reload http://your-veras-ip-address:3480/data_request?id=reload.
    Your new device should appear.

Thanks tinman for your reply and sorry for my late reply. Actually wondering for what i need RFXtrx? Do you thing i have to buy it to work with Avera plus and Kerui?

If the Kerui smoke detector operates at 433.92 Mhz then the RFXtrx transceiver is required if you want to have it appear as a device in the Vera user interface. Vera controllers do not have a non-proprietary 433.92 Mhz receiver. I’m not sure but I believe that several Kerui devices use the same protocol when transmitting messages. So when first appearing on the Vera it may show up as a different device type but you should be able to convert it to a smoke detector. But I don’t have any Kerui smoke detectors that I could use to confirm this.

Thanks i will try to get RFXtrx and try.

Please whom have an idea about connecting the multifunction switch to Vera. For example i have the ventilator Model : EicoE25 and i want to connect it to vera. The ventilator does not start unless i press the power bottom (touch hand buttoms). Thanks

If this ventilator does not have remote control capability (and viewing the available online information seems to show this), adding it will be difficult.