Lux Sensor and Binary Sensor

Hi, I have a lux sensor that I’m using to control lights in my house.

I’m using a binary sensor to show the state change and control automations but if the connection to the lux sensor drops the binary sensor state changes and the automations are triggered again.

Is there any way around this?

Thanks.

Put a condition in the automation or binary template sensor that checks that the lux sensor is not unavailable.