Hi, im getting started with HA, im listening for an Android intent (headphone battery) but the problem is, when i poweroff headset, the battery level is sent as -1.
How can i filter this? and only allow numbers in range 0-100?
for reference basically I copied this:
Hello, thanks for your help. This is my current code. Im readong about filters now. Since my problem is that the attribute is set to ‘-1’ on disconnect, the numeric_state seems to be the right option.
Still no idea on how to tie those down.
Thanks!!! I’ll try that as soon as I get back home, for what i understand it’s what i need. If I wanted to use is_number filter, is it possible? I can’t figure how to do it.