I would say you need to look at what is possible with micro PLC’s for a reasonable cost. Then consider a range of sensor options compatible with PLC’s which can communicate directly with HA via wifi while also being wired to PLC inputs for positive control and increased reliability if you require.
See here for PLC specific info.
I am working on more information to be added in my post over the next few weeks and will post here again as that information may be relevant to your needs.