The bin/ha_test.rs tool is a simple CLI tool to test the Home Assistant WebSocket API connectivity with the exact same code & logic as the HA integration for Remote Two.
The main purpose of this tool is to troubleshoot connectivity issues from a PC. X64 binaries for Linux, macOS and Windows are automatically built with a GitHub action.
Functionality
Connect to the HA server and authenticate with the token
Subscribe to entity state events: subscribe_events
Request the entity states: get_states
Disconnect
Required parameters
HA long lived access token.
HA WebSocket URL. Default if not provided: ws://homeassistant.local:8123/api/websocket
The configuration can either be provided in a home-assistant.json file in the current directory (see ./resources directory for a template), or through command line parameters.
Usage
/ha-test --help
Home Assistant server communication test
Usage: ha-test [OPTIONS]
Options:
-u <url> Home Assistant WebSocket API URL (overrides home-assistant.json) [default: ws://homeassistant.local:8123/api/websocket]
-t <token> Home Assistant long lived access token (overrides home-assistant.json)
-c <connection_timeout> TCP connection timeout in seconds (overrides home-assistant.json)
-r <request_timeout> Request timeout in seconds (overrides home-assistant.json)
--trace <MESSAGES> Message tracing for HA server communication [default: all] [possible values: in, out, all, none]
-h, --help Print help
-V, --version Print version
The
bin/ha_test.rs
tool is a simple CLI tool to test the Home Assistant WebSocket API connectivity with the exact same code & logic as the HA integration for Remote Two.The main purpose of this tool is to troubleshoot connectivity issues from a PC. X64 binaries for Linux, macOS and Windows are automatically built with a GitHub action.
Functionality
subscribe_events
get_states
Required parameters
ws://homeassistant.local:8123/api/websocket
The configuration can either be provided in a
home-assistant.json
file in the current directory (see ./resources directory for a template), or through command line parameters.Usage