Watching Entities
Go Automate can watch a Home Assistant entity and print its state every time it changes. This powers shell scripts and status-bar modules that react to your home in real time.
Two ways to watch
Section titled “Two ways to watch”- Through the bridge (recommended) —
ha bridge watch entityconnects to the shared bridge, so many watchers reuse one connection to Home Assistant. This is the best choice for status bars and long-running watchers. - Direct (troubleshooting only) —
ha watch entityopens its own WebSocket connection. It uses the bridge by default and only falls back to a direct connection if the bridge is unavailable. Force a direct connection with--directwhen debugging.
Watch through the bridge
Section titled “Watch through the bridge”go-automate ha bridge watch entity input_boolean.guest_modeThe watcher prints the current state immediately, then prints again on every change. Pass
--socket to use a non-default bridge socket path:
go-automate ha bridge watch entity input_boolean.guest_mode --socket /tmp/go-automate-ha.sockWatch directly
Section titled “Watch directly”ha watch entity uses the bridge when it can and falls back to a direct connection
otherwise:
go-automate ha watch entity sensor.living_room_temperatureForce a direct connection for troubleshooting with --direct:
go-automate ha watch entity sensor.living_room_temperature --directStatus bars
Section titled “Status bars”Add --bar-json to emit machine-readable JSON lines instead of plain text. Each line is an
object with text, tooltip and class that any status bar, shell or script can consume,
including Waybar and Quickshell.
See Bar JSON for the full output contract and every flag.
go-automate ha bridge watch entity input_boolean.guest_mode \ --bar-json \ --text-on "Guest" \ --tooltip-on "Guest mode is on" \ --tooltip-off "Guest mode is off" \ --class-on "active" \ --hide-offFor the full output contract, every --bar-json flag and a complete Waybar module, see
Bar JSON.
Connection flags differ by command:
| Flag | Command | Effect |
|---|---|---|
--socket | ha bridge watch entity | Path to the bridge socket. |
--direct | ha watch entity | Bypass the bridge and connect directly. |
--bridge-socket | ha watch entity | Path to the bridge socket to try before falling back. |
Next steps
Section titled “Next steps”- See Bar JSON to wire a watcher into a status bar.
- Make sure the bridge is running for the lowest network usage.
- See the Bridge Protocol for how watchers talk to the bridge.