[ST Edge] Life cycle handler when the Hub's IP address changes

In the early days of Edge, there was a lifecycle handler - lan_info_changed_handler - in some of the example drivers that was called in the event that the hub IP address changed. However, this is not in the current lifecycle documentation. Is this still supported? I have a case where connections to my LAN devices got messed up because the hub address changed, so I really do need this notification so I can better handle these cases.


This is really interesting… :thinking:
I’ll ask the engineering team and let you know once I get more info.

1 Like

That handler is still available, if you add the reference you mentioned (lan_info_changed_handler) in the driver and define a callback, you should get the event when the IP address changes.
Also, you can check the current IP address (if it’s known) using the driver.environment_info.hub_ipv4 property.

1 Like

It’s still in driver.lua at line 298. I’ve been wondering about what’s going on with it as I often seen the “Z-Wave hub node ID environment changed.” log at line 303 post in LAN and Zigbee drivers. In a LAN driver I was just able to get zwave_handler to trigger when the driver restarted.

local driver = Driver('test-lan', {
      discovery = discovery_handler,
      lan_info_changed_handler = lan_handler,
      zwave_hub_node_id_changed_handler = zwave_handler,

Thank you! I trust it will stay and be added to documentation :grimacing:

1 Like