Yes that’s the way for sensors. Binary sensors will always be on or off though.
on
off
Thank you, @tom_l !!