Need to get state of Android TV box

I have media box based on Android TV and use ADB integration for it.
I can’t find the right method to determine current state of this box.
I tried using the technique described in the documentation (wake_lock_size etc.) but it returns unpredictable results.
On physical level my box has two states - working and standby (or light sleeping). I can switch box between these states by Power button on IR-remote. In working state my box turns its screen on and I can watch TV or launch Android apps. In standby state the box turns its screen and sound off and becomes inoperable from IR-remote (excluding Power button of course).
However even in standby state the box is available on network. It responses to ping and even allows ADB connection.
I need do determine stanby state as off and working state as on (for use in automations etc.)
And the only way I found to correctly recognize the state of the box is to send an ADB command getprop sys.sysinfo.smartstandby.
If this command returns true then my box is in standby, but if false then the box is in working state.

However, I don’t know how to correctly add this method to the configuration.
Maybe someone can help me?
Thanks.