assist_satellite

Go types for Home Assistant's assist_satellite domain: control over HTTP.

Control: HTTP
import "github.com/taumatix/homeassistant-go/domains/assistsatellite"

Overview

Package assistsatellite is Home Assistant's assist_satellite domain: its types.

Entity controls one assist_satellite entity over HTTP.

No method for assist_satellite.ask_question, which only answer with data: call api.Client.CallServiceForResponse.

Home Assistant documents the domain here:

Integration: https://www.home-assistant.io/integrations/assist_satellite/

Entity model (developers): https://contributors.home-assistant.io/core/entities/assist-satellite/

Control

// client is an *api.Client
target := assistsatellite.Get(client, "my_assist_satellite")
state, err := target.State(ctx)
err = target.Announce(ctx)

Commands

What each Entity method does on each transport. Home Assistant has no MQTT discovery for this domain.

MethodOver HTTP, calls
Announce assist_satellite.announce
StartConversation assist_satellite.start_conversation

Services without a method

Call these with the REST or WebSocket client.

ServiceWhy
assist_satellite.ask_questionit only answers with data

Control

type Entity struct

Entity controls one assist_satellite entity over HTTP (api.Client). State and Subscribe come from the embedded Handle.

Embeds entity.Handle[Attributes], whose methods it has too.

func Get(transport entity.Transport, id string) *Entity

Get returns the assist_satellite entity with the given id: an entity id over HTTP (the "assist_satellite." prefix may be omitted). It does no I/O.

func List(ctx context.Context, transport entity.Transport) ([]*Entity, error)

List returns every assist_satellite entity the transport can see.

func (e *Entity) Announce(ctx context.Context, options ...entity.ServiceOption) error

Announce calls assist_satellite.announce. It has no MQTT equivalent. Core describes the service: Lets an Assist satellite announce a message.

func (e *Entity) StartConversation(ctx context.Context, options ...entity.ServiceOption) error

StartConversation calls assist_satellite.start_conversation. It has no MQTT equivalent. Core describes the service: Starts a conversation from an Assist satellite.

type State = entity.State[Attributes]

State is a snapshot of one assist_satellite entity.

func ExtraSystemPrompt(value string) entity.ServiceOption

ExtraSystemPrompt sets the "extra_system_prompt" service data field.

func MediaId(value any) entity.ServiceOption

MediaId sets the "media_id" service data field.

func Message(value string) entity.ServiceOption

Message sets the "message" service data field.

func Preannounce(value bool) entity.ServiceOption

Preannounce sets the "preannounce" service data field.

func PreannounceMediaId(value any) entity.ServiceOption

PreannounceMediaId sets the "preannounce_media_id" service data field.

func StartMediaId(value any) entity.ServiceOption

StartMediaId sets the "start_media_id" service data field.

func StartMessage(value string) entity.ServiceOption

StartMessage sets the "start_message" service data field.

State and values

type Attributes struct

Attributes are the state attributes of a assist_satellite entity, under the names Home Assistant publishes them with.

See: https://www.home-assistant.io/integrations/assist_satellite/

FieldTypeWire keyDescription
SupportedFeaturesFeaturesupported_features

A set of Feature flags.

type Answer struct

Answer is core's AssistSatelliteAnswer.

See: https://www.home-assistant.io/integrations/assist_satellite/

FieldTypeWire keyDescription
Id*stringid
Sentencestringsentence
Slotsmap[string]anyslots
type Configuration struct

Configuration is core's AssistSatelliteConfiguration.

See: https://www.home-assistant.io/integrations/assist_satellite/

FieldTypeWire keyDescription
ActiveWakeWords[]stringactive_wake_words
AvailableWakeWords[]WakeWordavailable_wake_words
MaxActiveWakeWordsintmax_active_wake_words

Feature

type Feature uint64

Feature is a set of assist_satellite supported features, with the values of core's AssistSatelliteEntityFeature: the supported_features attribute decodes into it.

ConstantValue
FeatureUnknown0
FeatureAnnounce1 << 0
FeatureStartConversation1 << 1
func FeatureFromString(s string) Feature

FeatureFromString returns the Feature spelled s, by its value or by the name of core's member, and FeatureUnknown for anything else.

StateValue

type StateValue string

StateValue lists the built-in values of the entity state, as Home Assistant translates them. Integrations may use others, which are kept as they are.

ConstantValue
StateValueUnknown"Unknown"
StateValueIdle"idle"
StateValueListening"listening"
StateValueProcessing"processing"
StateValueResponding"responding"
func StateValueFromString(s string) StateValue

StateValueFromString returns s as a StateValue.

func (v *StateValue) UnmarshalJSON(data []byte) error

UnmarshalJSON reads any spelling StateValueFromString accepts.

type WakeWord struct

WakeWord is core's AssistSatelliteWakeWord.

See: https://www.home-assistant.io/integrations/assist_satellite/

FieldTypeWire keyDescription
Idstringid
TrainedLanguages[]stringtrained_languages
WakeWordstringwake_word