Is there any way for automations to know if local push notifications are available?

At the moment I have a condition using a ping sensor to determine whether to send badge updates to my laptop, but was wondering if there’s a more elegant/reliable way to check.

For example, if the computer is home but the macOS companion app isn’t running, the ping sensor will be on, but it won’t be able to receive notifications via local push.