Analog in as switched input

Is it posible to use an analog input for a simple on/off switch? I’ve got a fluid level sensor(on/off style). I’m out of available digital inputs but still have a few analogs. Is it as simple as connecting the input to one side of the switch, and analog ground to the other? Thanks!

Yes, but you’ll need to enable a pull up if the device when ‘on’ goes to ground. Or disable the pull up if it goes to 5v. There is an activation threshold you’ll need to set as well for the on condition to work once the value is exceeded. Have a look at Switches → Custom. Set the Source as input and assign the Analog you are using.

Perfect, I appreciate your response!