maxwellhadley / node-red-contrib-rfxcom

node-RED nodes to access an RFXtrx433 transceiver
BSD 2-Clause "Simplified" License
22 stars 13 forks source link

AC switches only comes through the first time - anti-repeat? #62

Closed Mastiffen closed 5 years ago

Mastiffen commented 5 years ago

Hi again! This time I wonder about AC switches. I need a macro that needs the same switch to be pressed twice and sometimes three times. But at least within the few seconds that should be done, there's only coming one signal through. Is there an autorepeat for your plug-in somewhere, and can I turn that off? Thanks in advance!

maxwellhadley commented 5 years ago

Yes, there is an autorepeat. You can select either no repeat, send once after a delay, or send at regular intervals. It's controlled from the rfx-lights-out configuration panel: image

Does this do what you want?

Mastiffen commented 5 years ago

Acutally I think it's the opposite. I mean that I press a physical switch several times, and I only see it triggered once in Node-RED.

maxwellhadley commented 5 years ago

That isn't supposed to happen - every packet received from the RFXtrx generates a message. But I have found that my Home Easy remote controls, which are type AC, get a bit erratic with age. The buttons seem to get a bit dodgy, and sometimes you either get no transmission, or one at a lower power. The Red LED flash is dimmer in this case as well.

Mastiffen commented 5 years ago

There has to be something else going on here. I tested with two different switches at my cabin as well (the first try was at my house). They are 2-3 meters from the RFXtrx, and when I press seven times fast, only two comes in to the debugging in Node-RED. On the double switch every press comes in to the debugging if I press alternatly left and right switch. Is there some kind of an autorepeat built in to the RFXtrx?

maxwellhadley commented 5 years ago

I have investigated into this a bit more. The AC remotes, like most similar devices, actually transmit multiple repeats of the radio message: normally five, I believe. This gives time for the receiver AGC to operate correctly, and provides some sort of protection against impulsive interference. A 'normal' receiver such as a mains socket, even if it receives multiple copies of the same message & decodes them correctly, can only switch its relay on (or off) once, so there is no need for it to protect against receiving duplicated messages.

However this is not true for the RFXtrx433, as it doesn't know what the application is going to do with the received messages. To guard against unwanted duplication, the RFX seems to implement some sort of guard time, where if it receives another radio message with exactly the same contents inside the guard time, it is assumed to be one of the remote control's built-in repeats, so it is ignored. Hence if you press the button too quickly, with the same radio message as the last press, it is ignored. In my test system, an RFXtrx433E running Pro1 firmware version 1031, this time seems to be less than 0.5 second, when tested using a HomeEasy (UK) HE300W remote control. This would fit with your description of the left/right switch behaviour, as the radio messages will be different in that case. What make & model of switches are these?

It is possible this guard time has been changed during the history of RFX firmware development. I did note a changelog entry referring to the AC protocol, so if your firmware version is 1003 or older, you may have a different guard time value. What firmware version are you using? It is also possible (likely, even) that different types of remote transmit a different number of repeats of each message.

The rfx-lights-in node does not do any form of repeated message filtering: every packet received from the RFXtrx433 will generate an output message (if the address filtering is not set to ignore it).

If this is the problem, it may be worth reporting it to support@rfxcom.com suggesting the guard time might be reduced a bit

maxwellhadley commented 5 years ago

Can we close this one?

Mastiffen commented 5 years ago

Sorry... I guess you can, yeah. I have been away from home a long time, and I haven't been messing around with this since the thread was opened, but as you say it's something I need to ask RFX about.