[RFXCOM] Automatic update of device ID after batterie change?

I’ve just noticed that @martinvw is hardly working on improving the RFXCom-2-binding.
Therefore I’d like to ask for a solution for the changing device IDs when replacing batteries:

OpenHAB1: All my sensors (Oregon THxxx, RGxxx, Alecto WS1200) are changing their ID when the batteries are replaced. In the past, I had to check the logs for the new IDs and adjust my item files accordingly.

OpenHAB2: After batterie replacement and ID change a “new” thing will be discovered and shown in the inbox - correct? So I can take the ID of the newly discovered thing and adjust the ID of the existing (but offline) thing to get my linked items working again.

Despite not beeing perfect, this is for sure some improvement already as one do not need to check the logs for fixing the ID issue anymore. But how to simplify this further?

Is there some trick already to mitigate the changing ID issue?
If not, could we think about an “auto device ID” feature which changes the device ID of a rfxcom-thing in the case that:

  • a formerly known device was absent for at least (configurable) n minutes
  • battery was weak before disapearing (if the device is reporting battery level)
  • a thing of the same type is being discovered afterwards
  • (optional) the thing was explicitely permitted for “auto device ID” on its initial setup

Don’t know, if this achievable. But if it is - it would really simplify the use of these kind of devices.

2 Likes

Its a though one, the problem is that after replacing the batteries the device actually transmits a differerent Id. So I don’t know if it’s proper to assume that devices with a different Id replace each other.

How do other people feel about this, I understand it from a user perspective but from a code perspective it feels like a dangerous assumption.

I could have written the exact same post than the first one, i have exactly this problem.

I have a RFXCOM with nearly 10 oregon scientific devices, and each time i have to replace the batteries, indeed, the ID is changing.

In fact, i started writing a small program about that (but had no time to finish it yet) : read datas from the various devices throught the RFXCOM, republish them to MQTT topics, and between those 2 steps, have a mapping between device ID (read from RFXCOM) <> device names (“logical names” inside the MQTT topics).

That transformation would be defined dynamically with :

  • a few web transactions to handle that through a web browser
  • automatic mails sent when a new device is seen, with semi-automatic proposal about what to do, with the kind of rules seen in the first post of this topic, mainly “if one new device is found whereas one old device has not been seen in a while, then suggest to map the new device ID to the old logical name”.

But if something automatic is available directly inside openhab, it would of course be easier.

With persistence it should be possible in many cases to match device discovery and correlate to last values. This would prefill data in new device or trigger an alert, but require user confirmation.

Any updates / new ideas on this subject ?

any updates?

I wonder how I should manage this - do you have automatic item linking turned off and keep the labels?
I have turned it on at the moment but I assume it’s a problem if the devices change, I guess I don’t have the history in my database?