Support Access¶
Support access is off by default and always initiated by the customer. The integration controls the session; a provider opens the tunnel.
Version 0.1.0
The bundled manual provider records a session but does not open a
network tunnel. No remote access is possible with this release. The
lifecycle, switch, services and timeout can already be tested.
Start a session¶
Use the Support access switch or the service:
service: sg_energy_hub.start_support_session
data:
duration_hours: 4
The session:
- optionally requests a temporary token from the configured licence server,
- asks the provider to open the channel,
- starts a countdown (default 4 h, maximum 24 h),
- closes automatically at the end or when the switch is turned off.
The Support time remaining sensor shows the remaining minutes. The Support access switch shows whether a session is active.
Stop a session¶
Turn the switch off or call:
service: sg_energy_hub.end_support_session
The session ends immediately and the token is discarded. A Home Assistant restart also ends the session; sessions are intentionally not persisted.
Token request¶
If licence_server_url is set in the options, the integration sends:
POST <licence_server_url>/v1/support/token
Content-Type: application/json
{
"license_id": "…",
"ha_uuid": "…",
"purpose": "support_session"
}
The response must contain {"token": "…"}. The token is passed to the provider
and never logged or stored. If the request fails, no session is started.
Implementing a provider¶
A provider implements two methods:
class SupportProvider(Protocol):
name: str
async def async_start(self, hass, token: str | None) -> None: ...
async def async_stop(self, hass) -> None: ...
WireGuard and Tailscale providers belong behind this interface. They must not
persist tokens, must be idempotent and must close the tunnel when
async_stop is called.