#test for when numeric entity goes unavailable

1 messages · Page 1 of 1 (latest)

austere dagger
#

As indicated, I am getting the number of messages available from an imap connection, and occasionally the message count becomes unavailable and I need to reload the imap connection.
What do i need to use in the automation to detect unavailable? the only choices in the automation 'GUI' are values and no choice available in the GUI for 'unavailable'.

Thanks in advance!

celest rapids
#

One way is that you create a state trigger and the check with template check if it is a number, or not.
{{ trigger.to_state.state | is_number }} should return you if the value is number or not.

supple sand
#

The state trigger has the UI option to select unavailable or unknown.
The numeric state one doesn't.

austere dagger
supple sand
#

No. Just use a state trigger with the option to unavailable and an action to restart the integration.

austere dagger
#

found it, Thanks, learn something new every day!

#

Is there a way to mark as the solution for me other than the 'this' emoji?

supple sand
#

You can add the Resolved tag to your posts. I did it for this one.