OpenMQTTGateway icon indicating copy to clipboard operation
OpenMQTTGateway copied to clipboard

Make measurement sensor expiry configurable

Open peterg79 opened this issue 8 months ago • 4 comments

Description:

Following up on https://github.com/1technophile/OpenMQTTGateway/issues/2121, I'd like to introduce a configurable expiration for measurement sensors. Default is 0 which means no expiry, to keep it backward compatible.

Checklist:

  • [X] The pull request is done against the latest development branch
  • [X] Only one feature/fix was added per PR and the code change compiles without warnings
  • [X] I accept the DCO.

peterg79 avatar Apr 13 '25 08:04 peterg79

Thanks for the PR.

I'm worried that we have sensors that publish sporadically for which this settings may not be relevant. I still think it is interesting for most of the sensors but for those who are not regular publishers we should propose a bypass rather than alerting HA of something being wrong but is not wrong. Maybe we could have a setting in the WebUI to configure this expire after function, it could be configured in minutes, if the user set it to 0 we don't send an expire_after during discovery.

1technophile avatar Aug 17 '25 23:08 1technophile

Thanks for the feedback! I'll do the change accordingly.

peterg79 avatar Sep 03 '25 07:09 peterg79

Change complete and verified, please review.

peterg79 avatar Sep 07 '25 08:09 peterg79

Thanks, could you add an explanation in the docs please: https://docs.openmqttgateway.com/integrate/home_assistant.html#auto-discovery

1technophile avatar Sep 07 '25 21:09 1technophile