yeah that's why i mentioned bluetooth because it uses much less power
but let's say you pick a "rugged" phone like a Blackview, which has a massive battery, they are a bit big and chunky but they run recent versions of android and are decently configurable, the lifespan is gonna be pretty good alone
then there is also the possibility of having the device plug into a beefy battery bank, assuming you can find a device that will actually go into sleep mode with the power plugged in, should be able to
if you unlock developer mode, also, probably you can tweak some more things in the wireless network and sleep mode controls to even further reduce its idle power draw
if it's doing nothing but listening to the wifi, and it's got a 4000+mAh battery like a typical rugged phone, with all the dev mode tweaks on, i bet it would run for maybe 2-4 weeks between charges, possibly longer, kinda depends on how leaky the battery is, some batteries stay charged longer than others