···
3
+
import "api_options.proto";
5
+
service APIConnection {
6
+
rpc hello (HelloRequest) returns (HelloResponse) {
7
+
option (needs_setup_connection) = false;
8
+
option (needs_authentication) = false;
10
+
rpc connect (ConnectRequest) returns (ConnectResponse) {
11
+
option (needs_setup_connection) = false;
12
+
option (needs_authentication) = false;
14
+
rpc disconnect (DisconnectRequest) returns (DisconnectResponse) {
15
+
option (needs_setup_connection) = false;
16
+
option (needs_authentication) = false;
18
+
rpc ping (PingRequest) returns (PingResponse) {
19
+
option (needs_setup_connection) = false;
20
+
option (needs_authentication) = false;
22
+
rpc device_info (DeviceInfoRequest) returns (DeviceInfoResponse) {
23
+
option (needs_authentication) = false;
25
+
rpc list_entities (ListEntitiesRequest) returns (void) {}
26
+
rpc subscribe_states (SubscribeStatesRequest) returns (void) {}
27
+
rpc subscribe_logs (SubscribeLogsRequest) returns (void) {}
28
+
rpc subscribe_homeassistant_services (SubscribeHomeassistantServicesRequest) returns (void) {}
29
+
rpc subscribe_home_assistant_states (SubscribeHomeAssistantStatesRequest) returns (void) {}
30
+
rpc get_time (GetTimeRequest) returns (GetTimeResponse) {
31
+
option (needs_authentication) = false;
33
+
rpc execute_service (ExecuteServiceRequest) returns (void) {}
34
+
rpc noise_encryption_set_key (NoiseEncryptionSetKeyRequest) returns (NoiseEncryptionSetKeyResponse) {}
36
+
rpc button_command (ButtonCommandRequest) returns (void) {}
37
+
rpc camera_image (CameraImageRequest) returns (void) {}
38
+
rpc climate_command (ClimateCommandRequest) returns (void) {}
39
+
rpc cover_command (CoverCommandRequest) returns (void) {}
40
+
rpc date_command (DateCommandRequest) returns (void) {}
41
+
rpc datetime_command (DateTimeCommandRequest) returns (void) {}
42
+
rpc fan_command (FanCommandRequest) returns (void) {}
43
+
rpc light_command (LightCommandRequest) returns (void) {}
44
+
rpc lock_command (LockCommandRequest) returns (void) {}
45
+
rpc media_player_command (MediaPlayerCommandRequest) returns (void) {}
46
+
rpc number_command (NumberCommandRequest) returns (void) {}
47
+
rpc select_command (SelectCommandRequest) returns (void) {}
48
+
rpc siren_command (SirenCommandRequest) returns (void) {}
49
+
rpc switch_command (SwitchCommandRequest) returns (void) {}
50
+
rpc text_command (TextCommandRequest) returns (void) {}
51
+
rpc time_command (TimeCommandRequest) returns (void) {}
52
+
rpc update_command (UpdateCommandRequest) returns (void) {}
53
+
rpc valve_command (ValveCommandRequest) returns (void) {}
55
+
rpc subscribe_bluetooth_le_advertisements(SubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
56
+
rpc bluetooth_device_request(BluetoothDeviceRequest) returns (void) {}
57
+
rpc bluetooth_gatt_get_services(BluetoothGATTGetServicesRequest) returns (void) {}
58
+
rpc bluetooth_gatt_read(BluetoothGATTReadRequest) returns (void) {}
59
+
rpc bluetooth_gatt_write(BluetoothGATTWriteRequest) returns (void) {}
60
+
rpc bluetooth_gatt_read_descriptor(BluetoothGATTReadDescriptorRequest) returns (void) {}
61
+
rpc bluetooth_gatt_write_descriptor(BluetoothGATTWriteDescriptorRequest) returns (void) {}
62
+
rpc bluetooth_gatt_notify(BluetoothGATTNotifyRequest) returns (void) {}
63
+
rpc subscribe_bluetooth_connections_free(SubscribeBluetoothConnectionsFreeRequest) returns (BluetoothConnectionsFreeResponse) {}
64
+
rpc unsubscribe_bluetooth_le_advertisements(UnsubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
65
+
rpc bluetooth_scanner_set_mode(BluetoothScannerSetModeRequest) returns (void) {}
67
+
rpc subscribe_voice_assistant(SubscribeVoiceAssistantRequest) returns (void) {}
68
+
rpc voice_assistant_get_configuration(VoiceAssistantConfigurationRequest) returns (VoiceAssistantConfigurationResponse) {}
69
+
rpc voice_assistant_set_configuration(VoiceAssistantSetConfiguration) returns (void) {}
71
+
rpc alarm_control_panel_command (AlarmControlPanelCommandRequest) returns (void) {}
75
+
// ==================== BASE PACKETS ====================
77
+
// The Home Assistant protocol is structured as a simple
78
+
// TCP socket with short binary messages encoded in the protocol buffers format
79
+
// First, a message in this protocol has a specific format:
81
+
// * VarInt denoting the size of the message object. (type is not part of this)
82
+
// * VarInt denoting the type of message.
83
+
// * The message object encoded as a ProtoBuf message
85
+
// The connection is established in 4 steps:
86
+
// * First, the client connects to the server and sends a "Hello Request" identifying itself
87
+
// * The server responds with a "Hello Response" and selects the protocol version
88
+
// * After receiving this message, the client attempts to authenticate itself using
89
+
// the password and a "Connect Request"
90
+
// * The server responds with a "Connect Response" and notifies of invalid password.
91
+
// If anything in this initial process fails, the connection must immediately closed
92
+
// by both sides and _no_ disconnection message is to be sent.
94
+
// Message sent at the beginning of each connection
95
+
// Can only be sent by the client and only at the beginning of the connection
96
+
message HelloRequest {
98
+
option (source) = SOURCE_CLIENT;
99
+
option (no_delay) = true;
101
+
// Description of client (like User Agent)
102
+
// For example "Home Assistant"
103
+
// Not strictly necessary to send but nice for debugging
105
+
string client_info = 1;
106
+
uint32 api_version_major = 2;
107
+
uint32 api_version_minor = 3;
110
+
// Confirmation of successful connection request.
111
+
// Can only be sent by the server and only at the beginning of the connection
112
+
message HelloResponse {
114
+
option (source) = SOURCE_SERVER;
115
+
option (no_delay) = true;
117
+
// The version of the API to use. The _client_ (for example Home Assistant) needs to check
118
+
// for compatibility and if necessary adopt to an older API.
119
+
// Major is for breaking changes in the base protocol - a mismatch will lead to immediate disconnect_client_
120
+
// Minor is for breaking changes in individual messages - a mismatch will lead to a warning message
121
+
uint32 api_version_major = 1;
122
+
uint32 api_version_minor = 2;
124
+
// A string identifying the server (ESP); like client info this may be empty
125
+
// and only exists for debugging/logging purposes.
126
+
// For example "ESPHome v1.10.0 on ESP8266"
127
+
string server_info = 3;
129
+
// The name of the server (App.get_name())
133
+
// Message sent at the beginning of each connection to authenticate the client
134
+
// Can only be sent by the client and only at the beginning of the connection
135
+
message ConnectRequest {
137
+
option (source) = SOURCE_CLIENT;
138
+
option (no_delay) = true;
140
+
// The password to log in with
141
+
string password = 1;
144
+
// Confirmation of successful connection. After this the connection is available for all traffic.
145
+
// Can only be sent by the server and only at the beginning of the connection
146
+
message ConnectResponse {
148
+
option (source) = SOURCE_SERVER;
149
+
option (no_delay) = true;
151
+
bool invalid_password = 1;
154
+
// Request to close the connection.
155
+
// Can be sent by both the client and server
156
+
message DisconnectRequest {
158
+
option (source) = SOURCE_BOTH;
159
+
option (no_delay) = true;
161
+
// Do not close the connection before the acknowledgement arrives
164
+
message DisconnectResponse {
166
+
option (source) = SOURCE_BOTH;
167
+
option (no_delay) = true;
169
+
// Empty - Both parties are required to close the connection after this
170
+
// message has been received.
173
+
message PingRequest {
175
+
option (source) = SOURCE_BOTH;
179
+
message PingResponse {
181
+
option (source) = SOURCE_BOTH;
185
+
message DeviceInfoRequest {
187
+
option (source) = SOURCE_CLIENT;
192
+
uint32 area_id = 1;
196
+
message DeviceInfo {
197
+
uint32 device_id = 1;
199
+
uint32 area_id = 3;
202
+
message DeviceInfoResponse {
204
+
option (source) = SOURCE_SERVER;
206
+
bool uses_password = 1;
208
+
// The name of the node, given by "App.set_name()"
211
+
// The mac address of the device. For example "AC:BC:32:89:0E:A9"
212
+
string mac_address = 3;
214
+
// A string describing the ESPHome version. For example "1.10.0"
215
+
string esphome_version = 4;
217
+
// A string describing the date of compilation, this is generated by the compiler
218
+
// and therefore may not be in the same format all the time.
219
+
// If the user isn't using ESPHome, this will also not be set.
220
+
string compilation_time = 5;
222
+
// The model of the board. For example NodeMCU
225
+
bool has_deep_sleep = 7;
227
+
// The esphome project details if set
228
+
string project_name = 8;
229
+
string project_version = 9;
231
+
uint32 webserver_port = 10;
233
+
uint32 legacy_bluetooth_proxy_version = 11;
234
+
uint32 bluetooth_proxy_feature_flags = 15;
236
+
string manufacturer = 12;
238
+
string friendly_name = 13;
240
+
uint32 legacy_voice_assistant_version = 14;
241
+
uint32 voice_assistant_feature_flags = 17;
243
+
string suggested_area = 16;
245
+
// The Bluetooth mac address of the device. For example "AC:BC:32:89:0E:AA"
246
+
string bluetooth_mac_address = 18;
248
+
// Supports receiving and saving api encryption key
249
+
bool api_encryption_supported = 19;
251
+
repeated DeviceInfo devices = 20;
252
+
repeated AreaInfo areas = 21;
254
+
// Top-level area info to phase out suggested_area
255
+
AreaInfo area = 22;
258
+
message ListEntitiesRequest {
260
+
option (source) = SOURCE_CLIENT;
263
+
message ListEntitiesDoneResponse {
265
+
option (source) = SOURCE_SERVER;
266
+
option (no_delay) = true;
269
+
message SubscribeStatesRequest {
271
+
option (source) = SOURCE_CLIENT;
275
+
// ==================== COMMON =====================
277
+
enum EntityCategory {
278
+
ENTITY_CATEGORY_NONE = 0;
279
+
ENTITY_CATEGORY_CONFIG = 1;
280
+
ENTITY_CATEGORY_DIAGNOSTIC = 2;
283
+
// ==================== BINARY SENSOR ====================
284
+
message ListEntitiesBinarySensorResponse {
286
+
option (base_class) = "InfoResponseProtoMessage";
287
+
option (source) = SOURCE_SERVER;
288
+
option (ifdef) = "USE_BINARY_SENSOR";
290
+
string object_id = 1;
293
+
string unique_id = 4;
295
+
string device_class = 5;
296
+
bool is_status_binary_sensor = 6;
297
+
bool disabled_by_default = 7;
299
+
EntityCategory entity_category = 9;
300
+
uint32 device_id = 10;
302
+
message BinarySensorStateResponse {
304
+
option (base_class) = "StateResponseProtoMessage";
305
+
option (source) = SOURCE_SERVER;
306
+
option (ifdef) = "USE_BINARY_SENSOR";
307
+
option (no_delay) = true;
311
+
// If the binary sensor does not have a valid state yet.
312
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
313
+
bool missing_state = 3;
314
+
uint32 device_id = 4;
317
+
// ==================== COVER ====================
318
+
message ListEntitiesCoverResponse {
320
+
option (base_class) = "InfoResponseProtoMessage";
321
+
option (source) = SOURCE_SERVER;
322
+
option (ifdef) = "USE_COVER";
324
+
string object_id = 1;
327
+
string unique_id = 4;
329
+
bool assumed_state = 5;
330
+
bool supports_position = 6;
331
+
bool supports_tilt = 7;
332
+
string device_class = 8;
333
+
bool disabled_by_default = 9;
335
+
EntityCategory entity_category = 11;
336
+
bool supports_stop = 12;
337
+
uint32 device_id = 13;
340
+
enum LegacyCoverState {
341
+
LEGACY_COVER_STATE_OPEN = 0;
342
+
LEGACY_COVER_STATE_CLOSED = 1;
344
+
enum CoverOperation {
345
+
COVER_OPERATION_IDLE = 0;
346
+
COVER_OPERATION_IS_OPENING = 1;
347
+
COVER_OPERATION_IS_CLOSING = 2;
349
+
message CoverStateResponse {
351
+
option (base_class) = "StateResponseProtoMessage";
352
+
option (source) = SOURCE_SERVER;
353
+
option (ifdef) = "USE_COVER";
354
+
option (no_delay) = true;
357
+
// legacy: state has been removed in 1.13
358
+
// clients/servers must still send/accept it until the next protocol change
359
+
LegacyCoverState legacy_state = 2;
361
+
float position = 3;
363
+
CoverOperation current_operation = 5;
364
+
uint32 device_id = 6;
367
+
enum LegacyCoverCommand {
368
+
LEGACY_COVER_COMMAND_OPEN = 0;
369
+
LEGACY_COVER_COMMAND_CLOSE = 1;
370
+
LEGACY_COVER_COMMAND_STOP = 2;
372
+
message CoverCommandRequest {
374
+
option (source) = SOURCE_CLIENT;
375
+
option (ifdef) = "USE_COVER";
376
+
option (no_delay) = true;
380
+
// legacy: command has been removed in 1.13
381
+
// clients/servers must still send/accept it until the next protocol change
382
+
bool has_legacy_command = 2;
383
+
LegacyCoverCommand legacy_command = 3;
385
+
bool has_position = 4;
386
+
float position = 5;
392
+
// ==================== FAN ====================
393
+
message ListEntitiesFanResponse {
395
+
option (base_class) = "InfoResponseProtoMessage";
396
+
option (source) = SOURCE_SERVER;
397
+
option (ifdef) = "USE_FAN";
399
+
string object_id = 1;
402
+
string unique_id = 4;
404
+
bool supports_oscillation = 5;
405
+
bool supports_speed = 6;
406
+
bool supports_direction = 7;
407
+
int32 supported_speed_count = 8;
408
+
bool disabled_by_default = 9;
410
+
EntityCategory entity_category = 11;
411
+
repeated string supported_preset_modes = 12;
412
+
uint32 device_id = 13;
416
+
FAN_SPEED_MEDIUM = 1;
417
+
FAN_SPEED_HIGH = 2;
419
+
enum FanDirection {
420
+
FAN_DIRECTION_FORWARD = 0;
421
+
FAN_DIRECTION_REVERSE = 1;
423
+
message FanStateResponse {
425
+
option (base_class) = "StateResponseProtoMessage";
426
+
option (source) = SOURCE_SERVER;
427
+
option (ifdef) = "USE_FAN";
428
+
option (no_delay) = true;
432
+
bool oscillating = 3;
433
+
FanSpeed speed = 4 [deprecated = true];
434
+
FanDirection direction = 5;
435
+
int32 speed_level = 6;
436
+
string preset_mode = 7;
437
+
uint32 device_id = 8;
439
+
message FanCommandRequest {
441
+
option (source) = SOURCE_CLIENT;
442
+
option (ifdef) = "USE_FAN";
443
+
option (no_delay) = true;
446
+
bool has_state = 2;
448
+
bool has_speed = 4 [deprecated = true];
449
+
FanSpeed speed = 5 [deprecated = true];
450
+
bool has_oscillating = 6;
451
+
bool oscillating = 7;
452
+
bool has_direction = 8;
453
+
FanDirection direction = 9;
454
+
bool has_speed_level = 10;
455
+
int32 speed_level = 11;
456
+
bool has_preset_mode = 12;
457
+
string preset_mode = 13;
460
+
// ==================== LIGHT ====================
462
+
COLOR_MODE_UNKNOWN = 0;
463
+
COLOR_MODE_ON_OFF = 1;
464
+
COLOR_MODE_LEGACY_BRIGHTNESS = 2;
465
+
COLOR_MODE_BRIGHTNESS = 3;
466
+
COLOR_MODE_WHITE = 7;
467
+
COLOR_MODE_COLOR_TEMPERATURE = 11;
468
+
COLOR_MODE_COLD_WARM_WHITE = 19;
469
+
COLOR_MODE_RGB = 35;
470
+
COLOR_MODE_RGB_WHITE = 39;
471
+
COLOR_MODE_RGB_COLOR_TEMPERATURE = 47;
472
+
COLOR_MODE_RGB_COLD_WARM_WHITE = 51;
474
+
message ListEntitiesLightResponse {
476
+
option (base_class) = "InfoResponseProtoMessage";
477
+
option (source) = SOURCE_SERVER;
478
+
option (ifdef) = "USE_LIGHT";
480
+
string object_id = 1;
483
+
string unique_id = 4;
485
+
repeated ColorMode supported_color_modes = 12;
486
+
// next four supports_* are for legacy clients, newer clients should use color modes
487
+
bool legacy_supports_brightness = 5 [deprecated=true];
488
+
bool legacy_supports_rgb = 6 [deprecated=true];
489
+
bool legacy_supports_white_value = 7 [deprecated=true];
490
+
bool legacy_supports_color_temperature = 8 [deprecated=true];
491
+
float min_mireds = 9;
492
+
float max_mireds = 10;
493
+
repeated string effects = 11;
494
+
bool disabled_by_default = 13;
496
+
EntityCategory entity_category = 15;
497
+
uint32 device_id = 16;
499
+
message LightStateResponse {
501
+
option (base_class) = "StateResponseProtoMessage";
502
+
option (source) = SOURCE_SERVER;
503
+
option (ifdef) = "USE_LIGHT";
504
+
option (no_delay) = true;
508
+
float brightness = 3;
509
+
ColorMode color_mode = 11;
510
+
float color_brightness = 10;
515
+
float color_temperature = 8;
516
+
float cold_white = 12;
517
+
float warm_white = 13;
519
+
uint32 device_id = 14;
521
+
message LightCommandRequest {
523
+
option (source) = SOURCE_CLIENT;
524
+
option (ifdef) = "USE_LIGHT";
525
+
option (no_delay) = true;
528
+
bool has_state = 2;
530
+
bool has_brightness = 4;
531
+
float brightness = 5;
532
+
bool has_color_mode = 22;
533
+
ColorMode color_mode = 23;
534
+
bool has_color_brightness = 20;
535
+
float color_brightness = 21;
540
+
bool has_white = 10;
542
+
bool has_color_temperature = 12;
543
+
float color_temperature = 13;
544
+
bool has_cold_white = 24;
545
+
float cold_white = 25;
546
+
bool has_warm_white = 26;
547
+
float warm_white = 27;
548
+
bool has_transition_length = 14;
549
+
uint32 transition_length = 15;
550
+
bool has_flash_length = 16;
551
+
uint32 flash_length = 17;
552
+
bool has_effect = 18;
553
+
string effect = 19;
556
+
// ==================== SENSOR ====================
557
+
enum SensorStateClass {
558
+
STATE_CLASS_NONE = 0;
559
+
STATE_CLASS_MEASUREMENT = 1;
560
+
STATE_CLASS_TOTAL_INCREASING = 2;
561
+
STATE_CLASS_TOTAL = 3;
564
+
enum SensorLastResetType {
565
+
LAST_RESET_NONE = 0;
566
+
LAST_RESET_NEVER = 1;
567
+
LAST_RESET_AUTO = 2;
570
+
message ListEntitiesSensorResponse {
572
+
option (base_class) = "InfoResponseProtoMessage";
573
+
option (source) = SOURCE_SERVER;
574
+
option (ifdef) = "USE_SENSOR";
576
+
string object_id = 1;
579
+
string unique_id = 4;
582
+
string unit_of_measurement = 6;
583
+
int32 accuracy_decimals = 7;
584
+
bool force_update = 8;
585
+
string device_class = 9;
586
+
SensorStateClass state_class = 10;
587
+
// Last reset type removed in 2021.9.0
588
+
SensorLastResetType legacy_last_reset_type = 11;
589
+
bool disabled_by_default = 12;
590
+
EntityCategory entity_category = 13;
591
+
uint32 device_id = 14;
593
+
message SensorStateResponse {
595
+
option (base_class) = "StateResponseProtoMessage";
596
+
option (source) = SOURCE_SERVER;
597
+
option (ifdef) = "USE_SENSOR";
598
+
option (no_delay) = true;
602
+
// If the sensor does not have a valid state yet.
603
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
604
+
bool missing_state = 3;
605
+
uint32 device_id = 4;
608
+
// ==================== SWITCH ====================
609
+
message ListEntitiesSwitchResponse {
611
+
option (base_class) = "InfoResponseProtoMessage";
612
+
option (source) = SOURCE_SERVER;
613
+
option (ifdef) = "USE_SWITCH";
615
+
string object_id = 1;
618
+
string unique_id = 4;
621
+
bool assumed_state = 6;
622
+
bool disabled_by_default = 7;
623
+
EntityCategory entity_category = 8;
624
+
string device_class = 9;
625
+
uint32 device_id = 10;
627
+
message SwitchStateResponse {
629
+
option (base_class) = "StateResponseProtoMessage";
630
+
option (source) = SOURCE_SERVER;
631
+
option (ifdef) = "USE_SWITCH";
632
+
option (no_delay) = true;
636
+
uint32 device_id = 3;
638
+
message SwitchCommandRequest {
640
+
option (source) = SOURCE_CLIENT;
641
+
option (ifdef) = "USE_SWITCH";
642
+
option (no_delay) = true;
648
+
// ==================== TEXT SENSOR ====================
649
+
message ListEntitiesTextSensorResponse {
651
+
option (base_class) = "InfoResponseProtoMessage";
652
+
option (source) = SOURCE_SERVER;
653
+
option (ifdef) = "USE_TEXT_SENSOR";
655
+
string object_id = 1;
658
+
string unique_id = 4;
661
+
bool disabled_by_default = 6;
662
+
EntityCategory entity_category = 7;
663
+
string device_class = 8;
664
+
uint32 device_id = 9;
666
+
message TextSensorStateResponse {
668
+
option (base_class) = "StateResponseProtoMessage";
669
+
option (source) = SOURCE_SERVER;
670
+
option (ifdef) = "USE_TEXT_SENSOR";
671
+
option (no_delay) = true;
675
+
// If the text sensor does not have a valid state yet.
676
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
677
+
bool missing_state = 3;
678
+
uint32 device_id = 4;
681
+
// ==================== SUBSCRIBE LOGS ====================
683
+
LOG_LEVEL_NONE = 0;
684
+
LOG_LEVEL_ERROR = 1;
685
+
LOG_LEVEL_WARN = 2;
686
+
LOG_LEVEL_INFO = 3;
687
+
LOG_LEVEL_CONFIG = 4;
688
+
LOG_LEVEL_DEBUG = 5;
689
+
LOG_LEVEL_VERBOSE = 6;
690
+
LOG_LEVEL_VERY_VERBOSE = 7;
692
+
message SubscribeLogsRequest {
694
+
option (source) = SOURCE_CLIENT;
695
+
LogLevel level = 1;
696
+
bool dump_config = 2;
698
+
message SubscribeLogsResponse {
700
+
option (source) = SOURCE_SERVER;
701
+
option (log) = false;
702
+
option (no_delay) = false;
704
+
LogLevel level = 1;
706
+
bool send_failed = 4;
709
+
// ==================== NOISE ENCRYPTION ====================
710
+
message NoiseEncryptionSetKeyRequest {
712
+
option (source) = SOURCE_CLIENT;
713
+
option (ifdef) = "USE_API_NOISE";
718
+
message NoiseEncryptionSetKeyResponse {
720
+
option (source) = SOURCE_SERVER;
721
+
option (ifdef) = "USE_API_NOISE";
726
+
// ==================== HOMEASSISTANT.SERVICE ====================
727
+
message SubscribeHomeassistantServicesRequest {
729
+
option (source) = SOURCE_CLIENT;
732
+
message HomeassistantServiceMap {
737
+
message HomeassistantServiceResponse {
739
+
option (source) = SOURCE_SERVER;
740
+
option (no_delay) = true;
742
+
string service = 1;
743
+
repeated HomeassistantServiceMap data = 2;
744
+
repeated HomeassistantServiceMap data_template = 3;
745
+
repeated HomeassistantServiceMap variables = 4;
749
+
// ==================== IMPORT HOME ASSISTANT STATES ====================
750
+
// 1. Client sends SubscribeHomeAssistantStatesRequest
751
+
// 2. Server responds with zero or more SubscribeHomeAssistantStateResponse (async)
752
+
// 3. Client sends HomeAssistantStateResponse for state changes.
753
+
message SubscribeHomeAssistantStatesRequest {
755
+
option (source) = SOURCE_CLIENT;
758
+
message SubscribeHomeAssistantStateResponse {
760
+
option (source) = SOURCE_SERVER;
761
+
string entity_id = 1;
762
+
string attribute = 2;
766
+
message HomeAssistantStateResponse {
768
+
option (source) = SOURCE_CLIENT;
769
+
option (no_delay) = true;
771
+
string entity_id = 1;
773
+
string attribute = 3;
776
+
// ==================== IMPORT TIME ====================
777
+
message GetTimeRequest {
779
+
option (source) = SOURCE_BOTH;
782
+
message GetTimeResponse {
784
+
option (source) = SOURCE_BOTH;
785
+
option (no_delay) = true;
787
+
fixed32 epoch_seconds = 1;
790
+
// ==================== USER-DEFINES SERVICES ====================
791
+
enum ServiceArgType {
792
+
SERVICE_ARG_TYPE_BOOL = 0;
793
+
SERVICE_ARG_TYPE_INT = 1;
794
+
SERVICE_ARG_TYPE_FLOAT = 2;
795
+
SERVICE_ARG_TYPE_STRING = 3;
796
+
SERVICE_ARG_TYPE_BOOL_ARRAY = 4;
797
+
SERVICE_ARG_TYPE_INT_ARRAY = 5;
798
+
SERVICE_ARG_TYPE_FLOAT_ARRAY = 6;
799
+
SERVICE_ARG_TYPE_STRING_ARRAY = 7;
801
+
message ListEntitiesServicesArgument {
803
+
ServiceArgType type = 2;
805
+
message ListEntitiesServicesResponse {
807
+
option (source) = SOURCE_SERVER;
811
+
repeated ListEntitiesServicesArgument args = 3;
813
+
message ExecuteServiceArgument {
815
+
int32 legacy_int = 2;
817
+
string string_ = 4;
818
+
// ESPHome 1.14 (api v1.3) make int a signed value
820
+
repeated bool bool_array = 6 [packed=false];
821
+
repeated sint32 int_array = 7 [packed=false];
822
+
repeated float float_array = 8 [packed=false];
823
+
repeated string string_array = 9;
825
+
message ExecuteServiceRequest {
827
+
option (source) = SOURCE_CLIENT;
828
+
option (no_delay) = true;
831
+
repeated ExecuteServiceArgument args = 2;
834
+
// ==================== CAMERA ====================
835
+
message ListEntitiesCameraResponse {
837
+
option (base_class) = "InfoResponseProtoMessage";
838
+
option (source) = SOURCE_SERVER;
839
+
option (ifdef) = "USE_CAMERA";
841
+
string object_id = 1;
844
+
string unique_id = 4;
845
+
bool disabled_by_default = 5;
847
+
EntityCategory entity_category = 7;
848
+
uint32 device_id = 8;
851
+
message CameraImageResponse {
853
+
option (source) = SOURCE_SERVER;
854
+
option (ifdef) = "USE_CAMERA";
860
+
message CameraImageRequest {
862
+
option (source) = SOURCE_CLIENT;
863
+
option (ifdef) = "USE_CAMERA";
864
+
option (no_delay) = true;
870
+
// ==================== CLIMATE ====================
872
+
CLIMATE_MODE_OFF = 0;
873
+
CLIMATE_MODE_HEAT_COOL = 1;
874
+
CLIMATE_MODE_COOL = 2;
875
+
CLIMATE_MODE_HEAT = 3;
876
+
CLIMATE_MODE_FAN_ONLY = 4;
877
+
CLIMATE_MODE_DRY = 5;
878
+
CLIMATE_MODE_AUTO = 6;
880
+
enum ClimateFanMode {
881
+
CLIMATE_FAN_ON = 0;
882
+
CLIMATE_FAN_OFF = 1;
883
+
CLIMATE_FAN_AUTO = 2;
884
+
CLIMATE_FAN_LOW = 3;
885
+
CLIMATE_FAN_MEDIUM = 4;
886
+
CLIMATE_FAN_HIGH = 5;
887
+
CLIMATE_FAN_MIDDLE = 6;
888
+
CLIMATE_FAN_FOCUS = 7;
889
+
CLIMATE_FAN_DIFFUSE = 8;
890
+
CLIMATE_FAN_QUIET = 9;
892
+
enum ClimateSwingMode {
893
+
CLIMATE_SWING_OFF = 0;
894
+
CLIMATE_SWING_BOTH = 1;
895
+
CLIMATE_SWING_VERTICAL = 2;
896
+
CLIMATE_SWING_HORIZONTAL = 3;
898
+
enum ClimateAction {
899
+
CLIMATE_ACTION_OFF = 0;
900
+
// values same as mode for readability
901
+
CLIMATE_ACTION_COOLING = 2;
902
+
CLIMATE_ACTION_HEATING = 3;
903
+
CLIMATE_ACTION_IDLE = 4;
904
+
CLIMATE_ACTION_DRYING = 5;
905
+
CLIMATE_ACTION_FAN = 6;
907
+
enum ClimatePreset {
908
+
CLIMATE_PRESET_NONE = 0;
909
+
CLIMATE_PRESET_HOME = 1;
910
+
CLIMATE_PRESET_AWAY = 2;
911
+
CLIMATE_PRESET_BOOST = 3;
912
+
CLIMATE_PRESET_COMFORT = 4;
913
+
CLIMATE_PRESET_ECO = 5;
914
+
CLIMATE_PRESET_SLEEP = 6;
915
+
CLIMATE_PRESET_ACTIVITY = 7;
917
+
message ListEntitiesClimateResponse {
919
+
option (base_class) = "InfoResponseProtoMessage";
920
+
option (source) = SOURCE_SERVER;
921
+
option (ifdef) = "USE_CLIMATE";
923
+
string object_id = 1;
926
+
string unique_id = 4;
928
+
bool supports_current_temperature = 5;
929
+
bool supports_two_point_target_temperature = 6;
930
+
repeated ClimateMode supported_modes = 7;
931
+
float visual_min_temperature = 8;
932
+
float visual_max_temperature = 9;
933
+
float visual_target_temperature_step = 10;
934
+
// for older peer versions - in new system this
935
+
// is if CLIMATE_PRESET_AWAY exists is supported_presets
936
+
bool legacy_supports_away = 11;
937
+
bool supports_action = 12;
938
+
repeated ClimateFanMode supported_fan_modes = 13;
939
+
repeated ClimateSwingMode supported_swing_modes = 14;
940
+
repeated string supported_custom_fan_modes = 15;
941
+
repeated ClimatePreset supported_presets = 16;
942
+
repeated string supported_custom_presets = 17;
943
+
bool disabled_by_default = 18;
945
+
EntityCategory entity_category = 20;
946
+
float visual_current_temperature_step = 21;
947
+
bool supports_current_humidity = 22;
948
+
bool supports_target_humidity = 23;
949
+
float visual_min_humidity = 24;
950
+
float visual_max_humidity = 25;
951
+
uint32 device_id = 26;
953
+
message ClimateStateResponse {
955
+
option (base_class) = "StateResponseProtoMessage";
956
+
option (source) = SOURCE_SERVER;
957
+
option (ifdef) = "USE_CLIMATE";
958
+
option (no_delay) = true;
961
+
ClimateMode mode = 2;
962
+
float current_temperature = 3;
963
+
float target_temperature = 4;
964
+
float target_temperature_low = 5;
965
+
float target_temperature_high = 6;
966
+
// For older peers, equal to preset == CLIMATE_PRESET_AWAY
967
+
bool unused_legacy_away = 7;
968
+
ClimateAction action = 8;
969
+
ClimateFanMode fan_mode = 9;
970
+
ClimateSwingMode swing_mode = 10;
971
+
string custom_fan_mode = 11;
972
+
ClimatePreset preset = 12;
973
+
string custom_preset = 13;
974
+
float current_humidity = 14;
975
+
float target_humidity = 15;
976
+
uint32 device_id = 16;
978
+
message ClimateCommandRequest {
980
+
option (source) = SOURCE_CLIENT;
981
+
option (ifdef) = "USE_CLIMATE";
982
+
option (no_delay) = true;
986
+
ClimateMode mode = 3;
987
+
bool has_target_temperature = 4;
988
+
float target_temperature = 5;
989
+
bool has_target_temperature_low = 6;
990
+
float target_temperature_low = 7;
991
+
bool has_target_temperature_high = 8;
992
+
float target_temperature_high = 9;
993
+
// legacy, for older peers, newer ones should use CLIMATE_PRESET_AWAY in preset
994
+
bool unused_has_legacy_away = 10;
995
+
bool unused_legacy_away = 11;
996
+
bool has_fan_mode = 12;
997
+
ClimateFanMode fan_mode = 13;
998
+
bool has_swing_mode = 14;
999
+
ClimateSwingMode swing_mode = 15;
1000
+
bool has_custom_fan_mode = 16;
1001
+
string custom_fan_mode = 17;
1002
+
bool has_preset = 18;
1003
+
ClimatePreset preset = 19;
1004
+
bool has_custom_preset = 20;
1005
+
string custom_preset = 21;
1006
+
bool has_target_humidity = 22;
1007
+
float target_humidity = 23;
1010
+
// ==================== NUMBER ====================
1012
+
NUMBER_MODE_AUTO = 0;
1013
+
NUMBER_MODE_BOX = 1;
1014
+
NUMBER_MODE_SLIDER = 2;
1016
+
message ListEntitiesNumberResponse {
1018
+
option (base_class) = "InfoResponseProtoMessage";
1019
+
option (source) = SOURCE_SERVER;
1020
+
option (ifdef) = "USE_NUMBER";
1022
+
string object_id = 1;
1025
+
string unique_id = 4;
1028
+
float min_value = 6;
1029
+
float max_value = 7;
1031
+
bool disabled_by_default = 9;
1032
+
EntityCategory entity_category = 10;
1033
+
string unit_of_measurement = 11;
1034
+
NumberMode mode = 12;
1035
+
string device_class = 13;
1036
+
uint32 device_id = 14;
1038
+
message NumberStateResponse {
1040
+
option (base_class) = "StateResponseProtoMessage";
1041
+
option (source) = SOURCE_SERVER;
1042
+
option (ifdef) = "USE_NUMBER";
1043
+
option (no_delay) = true;
1047
+
// If the number does not have a valid state yet.
1048
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
1049
+
bool missing_state = 3;
1050
+
uint32 device_id = 4;
1052
+
message NumberCommandRequest {
1054
+
option (source) = SOURCE_CLIENT;
1055
+
option (ifdef) = "USE_NUMBER";
1056
+
option (no_delay) = true;
1062
+
// ==================== SELECT ====================
1063
+
message ListEntitiesSelectResponse {
1065
+
option (base_class) = "InfoResponseProtoMessage";
1066
+
option (source) = SOURCE_SERVER;
1067
+
option (ifdef) = "USE_SELECT";
1069
+
string object_id = 1;
1072
+
string unique_id = 4;
1075
+
repeated string options = 6;
1076
+
bool disabled_by_default = 7;
1077
+
EntityCategory entity_category = 8;
1078
+
uint32 device_id = 9;
1080
+
message SelectStateResponse {
1082
+
option (base_class) = "StateResponseProtoMessage";
1083
+
option (source) = SOURCE_SERVER;
1084
+
option (ifdef) = "USE_SELECT";
1085
+
option (no_delay) = true;
1089
+
// If the select does not have a valid state yet.
1090
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
1091
+
bool missing_state = 3;
1092
+
uint32 device_id = 4;
1094
+
message SelectCommandRequest {
1096
+
option (source) = SOURCE_CLIENT;
1097
+
option (ifdef) = "USE_SELECT";
1098
+
option (no_delay) = true;
1104
+
// ==================== SIREN ====================
1105
+
message ListEntitiesSirenResponse {
1107
+
option (base_class) = "InfoResponseProtoMessage";
1108
+
option (source) = SOURCE_SERVER;
1109
+
option (ifdef) = "USE_SIREN";
1111
+
string object_id = 1;
1114
+
string unique_id = 4;
1117
+
bool disabled_by_default = 6;
1118
+
repeated string tones = 7;
1119
+
bool supports_duration = 8;
1120
+
bool supports_volume = 9;
1121
+
EntityCategory entity_category = 10;
1122
+
uint32 device_id = 11;
1124
+
message SirenStateResponse {
1126
+
option (base_class) = "StateResponseProtoMessage";
1127
+
option (source) = SOURCE_SERVER;
1128
+
option (ifdef) = "USE_SIREN";
1129
+
option (no_delay) = true;
1133
+
uint32 device_id = 3;
1135
+
message SirenCommandRequest {
1137
+
option (source) = SOURCE_CLIENT;
1138
+
option (ifdef) = "USE_SIREN";
1139
+
option (no_delay) = true;
1142
+
bool has_state = 2;
1144
+
bool has_tone = 4;
1146
+
bool has_duration = 6;
1147
+
uint32 duration = 7;
1148
+
bool has_volume = 8;
1152
+
// ==================== LOCK ====================
1154
+
LOCK_STATE_NONE = 0;
1155
+
LOCK_STATE_LOCKED = 1;
1156
+
LOCK_STATE_UNLOCKED = 2;
1157
+
LOCK_STATE_JAMMED = 3;
1158
+
LOCK_STATE_LOCKING = 4;
1159
+
LOCK_STATE_UNLOCKING = 5;
1161
+
enum LockCommand {
1166
+
message ListEntitiesLockResponse {
1168
+
option (base_class) = "InfoResponseProtoMessage";
1169
+
option (source) = SOURCE_SERVER;
1170
+
option (ifdef) = "USE_LOCK";
1172
+
string object_id = 1;
1175
+
string unique_id = 4;
1178
+
bool disabled_by_default = 6;
1179
+
EntityCategory entity_category = 7;
1180
+
bool assumed_state = 8;
1182
+
bool supports_open = 9;
1183
+
bool requires_code = 10;
1185
+
// Not yet implemented:
1186
+
string code_format = 11;
1187
+
uint32 device_id = 12;
1189
+
message LockStateResponse {
1191
+
option (base_class) = "StateResponseProtoMessage";
1192
+
option (source) = SOURCE_SERVER;
1193
+
option (ifdef) = "USE_LOCK";
1194
+
option (no_delay) = true;
1196
+
LockState state = 2;
1197
+
uint32 device_id = 3;
1199
+
message LockCommandRequest {
1201
+
option (source) = SOURCE_CLIENT;
1202
+
option (ifdef) = "USE_LOCK";
1203
+
option (no_delay) = true;
1205
+
LockCommand command = 2;
1207
+
// Not yet implemented:
1208
+
bool has_code = 3;
1212
+
// ==================== BUTTON ====================
1213
+
message ListEntitiesButtonResponse {
1215
+
option (base_class) = "InfoResponseProtoMessage";
1216
+
option (source) = SOURCE_SERVER;
1217
+
option (ifdef) = "USE_BUTTON";
1219
+
string object_id = 1;
1222
+
string unique_id = 4;
1225
+
bool disabled_by_default = 6;
1226
+
EntityCategory entity_category = 7;
1227
+
string device_class = 8;
1228
+
uint32 device_id = 9;
1230
+
message ButtonCommandRequest {
1232
+
option (source) = SOURCE_CLIENT;
1233
+
option (ifdef) = "USE_BUTTON";
1234
+
option (no_delay) = true;
1239
+
// ==================== MEDIA PLAYER ====================
1240
+
enum MediaPlayerState {
1241
+
MEDIA_PLAYER_STATE_NONE = 0;
1242
+
MEDIA_PLAYER_STATE_IDLE = 1;
1243
+
MEDIA_PLAYER_STATE_PLAYING = 2;
1244
+
MEDIA_PLAYER_STATE_PAUSED = 3;
1246
+
enum MediaPlayerCommand {
1247
+
MEDIA_PLAYER_COMMAND_PLAY = 0;
1248
+
MEDIA_PLAYER_COMMAND_PAUSE = 1;
1249
+
MEDIA_PLAYER_COMMAND_STOP = 2;
1250
+
MEDIA_PLAYER_COMMAND_MUTE = 3;
1251
+
MEDIA_PLAYER_COMMAND_UNMUTE = 4;
1253
+
enum MediaPlayerFormatPurpose {
1254
+
MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT = 0;
1255
+
MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT = 1;
1257
+
message MediaPlayerSupportedFormat {
1258
+
option (ifdef) = "USE_MEDIA_PLAYER";
1260
+
string format = 1;
1261
+
uint32 sample_rate = 2;
1262
+
uint32 num_channels = 3;
1263
+
MediaPlayerFormatPurpose purpose = 4;
1264
+
uint32 sample_bytes = 5;
1266
+
message ListEntitiesMediaPlayerResponse {
1268
+
option (base_class) = "InfoResponseProtoMessage";
1269
+
option (source) = SOURCE_SERVER;
1270
+
option (ifdef) = "USE_MEDIA_PLAYER";
1272
+
string object_id = 1;
1275
+
string unique_id = 4;
1278
+
bool disabled_by_default = 6;
1279
+
EntityCategory entity_category = 7;
1281
+
bool supports_pause = 8;
1283
+
repeated MediaPlayerSupportedFormat supported_formats = 9;
1285
+
uint32 device_id = 10;
1287
+
message MediaPlayerStateResponse {
1289
+
option (base_class) = "StateResponseProtoMessage";
1290
+
option (source) = SOURCE_SERVER;
1291
+
option (ifdef) = "USE_MEDIA_PLAYER";
1292
+
option (no_delay) = true;
1294
+
MediaPlayerState state = 2;
1297
+
uint32 device_id = 5;
1299
+
message MediaPlayerCommandRequest {
1301
+
option (source) = SOURCE_CLIENT;
1302
+
option (ifdef) = "USE_MEDIA_PLAYER";
1303
+
option (no_delay) = true;
1307
+
bool has_command = 2;
1308
+
MediaPlayerCommand command = 3;
1310
+
bool has_volume = 4;
1313
+
bool has_media_url = 6;
1314
+
string media_url = 7;
1316
+
bool has_announcement = 8;
1317
+
bool announcement = 9;
1320
+
// ==================== BLUETOOTH ====================
1321
+
message SubscribeBluetoothLEAdvertisementsRequest {
1323
+
option (source) = SOURCE_CLIENT;
1324
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1329
+
message BluetoothServiceData {
1331
+
repeated uint32 legacy_data = 2 [deprecated = true]; // Removed in api version 1.7
1332
+
bytes data = 3; // Added in api version 1.7
1334
+
message BluetoothLEAdvertisementResponse {
1336
+
option (source) = SOURCE_SERVER;
1337
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1338
+
option (no_delay) = true;
1340
+
uint64 address = 1;
1344
+
repeated string service_uuids = 4;
1345
+
repeated BluetoothServiceData service_data = 5;
1346
+
repeated BluetoothServiceData manufacturer_data = 6;
1348
+
uint32 address_type = 7;
1351
+
message BluetoothLERawAdvertisement {
1352
+
uint64 address = 1;
1354
+
uint32 address_type = 3;
1359
+
message BluetoothLERawAdvertisementsResponse {
1361
+
option (source) = SOURCE_SERVER;
1362
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1363
+
option (no_delay) = true;
1365
+
repeated BluetoothLERawAdvertisement advertisements = 1;
1368
+
enum BluetoothDeviceRequestType {
1369
+
BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT = 0;
1370
+
BLUETOOTH_DEVICE_REQUEST_TYPE_DISCONNECT = 1;
1371
+
BLUETOOTH_DEVICE_REQUEST_TYPE_PAIR = 2;
1372
+
BLUETOOTH_DEVICE_REQUEST_TYPE_UNPAIR = 3;
1373
+
BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITH_CACHE = 4;
1374
+
BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITHOUT_CACHE = 5;
1375
+
BLUETOOTH_DEVICE_REQUEST_TYPE_CLEAR_CACHE = 6;
1378
+
message BluetoothDeviceRequest {
1380
+
option (source) = SOURCE_CLIENT;
1381
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1383
+
uint64 address = 1;
1384
+
BluetoothDeviceRequestType request_type = 2;
1385
+
bool has_address_type = 3;
1386
+
uint32 address_type = 4;
1389
+
message BluetoothDeviceConnectionResponse {
1391
+
option (source) = SOURCE_SERVER;
1392
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1394
+
uint64 address = 1;
1395
+
bool connected = 2;
1400
+
message BluetoothGATTGetServicesRequest {
1402
+
option (source) = SOURCE_CLIENT;
1403
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1405
+
uint64 address = 1;
1408
+
message BluetoothGATTDescriptor {
1409
+
repeated uint64 uuid = 1;
1410
+
uint32 handle = 2;
1413
+
message BluetoothGATTCharacteristic {
1414
+
repeated uint64 uuid = 1;
1415
+
uint32 handle = 2;
1416
+
uint32 properties = 3;
1417
+
repeated BluetoothGATTDescriptor descriptors = 4;
1420
+
message BluetoothGATTService {
1421
+
repeated uint64 uuid = 1;
1422
+
uint32 handle = 2;
1423
+
repeated BluetoothGATTCharacteristic characteristics = 3;
1426
+
message BluetoothGATTGetServicesResponse {
1428
+
option (source) = SOURCE_SERVER;
1429
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1431
+
uint64 address = 1;
1432
+
repeated BluetoothGATTService services = 2;
1435
+
message BluetoothGATTGetServicesDoneResponse {
1437
+
option (source) = SOURCE_SERVER;
1438
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1440
+
uint64 address = 1;
1443
+
message BluetoothGATTReadRequest {
1445
+
option (source) = SOURCE_CLIENT;
1446
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1448
+
uint64 address = 1;
1449
+
uint32 handle = 2;
1452
+
message BluetoothGATTReadResponse {
1454
+
option (source) = SOURCE_SERVER;
1455
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1457
+
uint64 address = 1;
1458
+
uint32 handle = 2;
1464
+
message BluetoothGATTWriteRequest {
1466
+
option (source) = SOURCE_CLIENT;
1467
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1469
+
uint64 address = 1;
1470
+
uint32 handle = 2;
1471
+
bool response = 3;
1476
+
message BluetoothGATTReadDescriptorRequest {
1478
+
option (source) = SOURCE_CLIENT;
1479
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1481
+
uint64 address = 1;
1482
+
uint32 handle = 2;
1485
+
message BluetoothGATTWriteDescriptorRequest {
1487
+
option (source) = SOURCE_CLIENT;
1488
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1490
+
uint64 address = 1;
1491
+
uint32 handle = 2;
1496
+
message BluetoothGATTNotifyRequest {
1498
+
option (source) = SOURCE_CLIENT;
1499
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1501
+
uint64 address = 1;
1502
+
uint32 handle = 2;
1506
+
message BluetoothGATTNotifyDataResponse {
1508
+
option (source) = SOURCE_SERVER;
1509
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1511
+
uint64 address = 1;
1512
+
uint32 handle = 2;
1517
+
message SubscribeBluetoothConnectionsFreeRequest {
1519
+
option (source) = SOURCE_CLIENT;
1520
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1523
+
message BluetoothConnectionsFreeResponse {
1525
+
option (source) = SOURCE_SERVER;
1526
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1530
+
repeated uint64 allocated = 3;
1533
+
message BluetoothGATTErrorResponse {
1535
+
option (source) = SOURCE_SERVER;
1536
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1538
+
uint64 address = 1;
1539
+
uint32 handle = 2;
1543
+
message BluetoothGATTWriteResponse {
1545
+
option (source) = SOURCE_SERVER;
1546
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1548
+
uint64 address = 1;
1549
+
uint32 handle = 2;
1552
+
message BluetoothGATTNotifyResponse {
1554
+
option (source) = SOURCE_SERVER;
1555
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1557
+
uint64 address = 1;
1558
+
uint32 handle = 2;
1561
+
message BluetoothDevicePairingResponse {
1563
+
option (source) = SOURCE_SERVER;
1564
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1566
+
uint64 address = 1;
1571
+
message BluetoothDeviceUnpairingResponse {
1573
+
option (source) = SOURCE_SERVER;
1574
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1576
+
uint64 address = 1;
1581
+
message UnsubscribeBluetoothLEAdvertisementsRequest {
1583
+
option (source) = SOURCE_CLIENT;
1584
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1587
+
message BluetoothDeviceClearCacheResponse {
1589
+
option (source) = SOURCE_SERVER;
1590
+
option (ifdef) = "USE_BLUETOOTH_PROXY";
1592
+
uint64 address = 1;
1597
+
enum BluetoothScannerState {
1598
+
BLUETOOTH_SCANNER_STATE_IDLE = 0;
1599
+
BLUETOOTH_SCANNER_STATE_STARTING = 1;
1600
+
BLUETOOTH_SCANNER_STATE_RUNNING = 2;
1601
+
BLUETOOTH_SCANNER_STATE_FAILED = 3;
1602
+
BLUETOOTH_SCANNER_STATE_STOPPING = 4;
1603
+
BLUETOOTH_SCANNER_STATE_STOPPED = 5;
1606
+
enum BluetoothScannerMode {
1607
+
BLUETOOTH_SCANNER_MODE_PASSIVE = 0;
1608
+
BLUETOOTH_SCANNER_MODE_ACTIVE = 1;
1611
+
message BluetoothScannerStateResponse {
1613
+
option(source) = SOURCE_SERVER;
1614
+
option(ifdef) = "USE_BLUETOOTH_PROXY";
1616
+
BluetoothScannerState state = 1;
1617
+
BluetoothScannerMode mode = 2;
1620
+
message BluetoothScannerSetModeRequest {
1622
+
option(source) = SOURCE_CLIENT;
1623
+
option(ifdef) = "USE_BLUETOOTH_PROXY";
1625
+
BluetoothScannerMode mode = 1;
1628
+
// ==================== VOICE ASSISTANT ====================
1629
+
enum VoiceAssistantSubscribeFlag {
1630
+
VOICE_ASSISTANT_SUBSCRIBE_NONE = 0;
1631
+
VOICE_ASSISTANT_SUBSCRIBE_API_AUDIO = 1;
1634
+
message SubscribeVoiceAssistantRequest {
1636
+
option (source) = SOURCE_CLIENT;
1637
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1639
+
bool subscribe = 1;
1643
+
enum VoiceAssistantRequestFlag {
1644
+
VOICE_ASSISTANT_REQUEST_NONE = 0;
1645
+
VOICE_ASSISTANT_REQUEST_USE_VAD = 1;
1646
+
VOICE_ASSISTANT_REQUEST_USE_WAKE_WORD = 2;
1649
+
message VoiceAssistantAudioSettings {
1650
+
uint32 noise_suppression_level = 1;
1651
+
uint32 auto_gain = 2;
1652
+
float volume_multiplier = 3;
1655
+
message VoiceAssistantRequest {
1657
+
option (source) = SOURCE_SERVER;
1658
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1661
+
string conversation_id = 2;
1663
+
VoiceAssistantAudioSettings audio_settings = 4;
1664
+
string wake_word_phrase = 5;
1667
+
message VoiceAssistantResponse {
1669
+
option (source) = SOURCE_CLIENT;
1670
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1676
+
enum VoiceAssistantEvent {
1677
+
VOICE_ASSISTANT_ERROR = 0;
1678
+
VOICE_ASSISTANT_RUN_START = 1;
1679
+
VOICE_ASSISTANT_RUN_END = 2;
1680
+
VOICE_ASSISTANT_STT_START = 3;
1681
+
VOICE_ASSISTANT_STT_END = 4;
1682
+
VOICE_ASSISTANT_INTENT_START = 5;
1683
+
VOICE_ASSISTANT_INTENT_END = 6;
1684
+
VOICE_ASSISTANT_TTS_START = 7;
1685
+
VOICE_ASSISTANT_TTS_END = 8;
1686
+
VOICE_ASSISTANT_WAKE_WORD_START = 9;
1687
+
VOICE_ASSISTANT_WAKE_WORD_END = 10;
1688
+
VOICE_ASSISTANT_STT_VAD_START = 11;
1689
+
VOICE_ASSISTANT_STT_VAD_END = 12;
1690
+
VOICE_ASSISTANT_TTS_STREAM_START = 98;
1691
+
VOICE_ASSISTANT_TTS_STREAM_END = 99;
1692
+
VOICE_ASSISTANT_INTENT_PROGRESS = 100;
1695
+
message VoiceAssistantEventData {
1700
+
message VoiceAssistantEventResponse {
1702
+
option (source) = SOURCE_CLIENT;
1703
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1705
+
VoiceAssistantEvent event_type = 1;
1706
+
repeated VoiceAssistantEventData data = 2;
1709
+
message VoiceAssistantAudio {
1710
+
option (id) = 106;
1711
+
option (source) = SOURCE_BOTH;
1712
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1718
+
enum VoiceAssistantTimerEvent {
1719
+
VOICE_ASSISTANT_TIMER_STARTED = 0;
1720
+
VOICE_ASSISTANT_TIMER_UPDATED = 1;
1721
+
VOICE_ASSISTANT_TIMER_CANCELLED = 2;
1722
+
VOICE_ASSISTANT_TIMER_FINISHED = 3;
1725
+
message VoiceAssistantTimerEventResponse {
1726
+
option (id) = 115;
1727
+
option (source) = SOURCE_CLIENT;
1728
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1730
+
VoiceAssistantTimerEvent event_type = 1;
1731
+
string timer_id = 2;
1733
+
uint32 total_seconds = 4;
1734
+
uint32 seconds_left = 5;
1735
+
bool is_active = 6;
1738
+
message VoiceAssistantAnnounceRequest {
1739
+
option (id) = 119;
1740
+
option (source) = SOURCE_CLIENT;
1741
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1743
+
string media_id = 1;
1745
+
string preannounce_media_id = 3;
1746
+
bool start_conversation = 4;
1749
+
message VoiceAssistantAnnounceFinished {
1750
+
option (id) = 120;
1751
+
option (source) = SOURCE_SERVER;
1752
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1757
+
message VoiceAssistantWakeWord {
1759
+
string wake_word = 2;
1760
+
repeated string trained_languages = 3;
1763
+
message VoiceAssistantConfigurationRequest {
1764
+
option (id) = 121;
1765
+
option (source) = SOURCE_CLIENT;
1766
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1769
+
message VoiceAssistantConfigurationResponse {
1770
+
option (id) = 122;
1771
+
option (source) = SOURCE_SERVER;
1772
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1774
+
repeated VoiceAssistantWakeWord available_wake_words = 1;
1775
+
repeated string active_wake_words = 2;
1776
+
uint32 max_active_wake_words = 3;
1779
+
message VoiceAssistantSetConfiguration {
1780
+
option (id) = 123;
1781
+
option (source) = SOURCE_CLIENT;
1782
+
option (ifdef) = "USE_VOICE_ASSISTANT";
1784
+
repeated string active_wake_words = 1;
1787
+
// ==================== ALARM CONTROL PANEL ====================
1788
+
enum AlarmControlPanelState {
1789
+
ALARM_STATE_DISARMED = 0;
1790
+
ALARM_STATE_ARMED_HOME = 1;
1791
+
ALARM_STATE_ARMED_AWAY = 2;
1792
+
ALARM_STATE_ARMED_NIGHT = 3;
1793
+
ALARM_STATE_ARMED_VACATION = 4;
1794
+
ALARM_STATE_ARMED_CUSTOM_BYPASS = 5;
1795
+
ALARM_STATE_PENDING = 6;
1796
+
ALARM_STATE_ARMING = 7;
1797
+
ALARM_STATE_DISARMING = 8;
1798
+
ALARM_STATE_TRIGGERED = 9;
1801
+
enum AlarmControlPanelStateCommand {
1802
+
ALARM_CONTROL_PANEL_DISARM = 0;
1803
+
ALARM_CONTROL_PANEL_ARM_AWAY = 1;
1804
+
ALARM_CONTROL_PANEL_ARM_HOME = 2;
1805
+
ALARM_CONTROL_PANEL_ARM_NIGHT = 3;
1806
+
ALARM_CONTROL_PANEL_ARM_VACATION = 4;
1807
+
ALARM_CONTROL_PANEL_ARM_CUSTOM_BYPASS = 5;
1808
+
ALARM_CONTROL_PANEL_TRIGGER = 6;
1811
+
message ListEntitiesAlarmControlPanelResponse {
1813
+
option (base_class) = "InfoResponseProtoMessage";
1814
+
option (source) = SOURCE_SERVER;
1815
+
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
1817
+
string object_id = 1;
1820
+
string unique_id = 4;
1822
+
bool disabled_by_default = 6;
1823
+
EntityCategory entity_category = 7;
1824
+
uint32 supported_features = 8;
1825
+
bool requires_code = 9;
1826
+
bool requires_code_to_arm = 10;
1827
+
uint32 device_id = 11;
1830
+
message AlarmControlPanelStateResponse {
1832
+
option (base_class) = "StateResponseProtoMessage";
1833
+
option (source) = SOURCE_SERVER;
1834
+
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
1835
+
option (no_delay) = true;
1837
+
AlarmControlPanelState state = 2;
1838
+
uint32 device_id = 3;
1841
+
message AlarmControlPanelCommandRequest {
1843
+
option (source) = SOURCE_CLIENT;
1844
+
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
1845
+
option (no_delay) = true;
1847
+
AlarmControlPanelStateCommand command = 2;
1851
+
// ===================== TEXT =====================
1853
+
TEXT_MODE_TEXT = 0;
1854
+
TEXT_MODE_PASSWORD = 1;
1856
+
message ListEntitiesTextResponse {
1858
+
option (base_class) = "InfoResponseProtoMessage";
1859
+
option (source) = SOURCE_SERVER;
1860
+
option (ifdef) = "USE_TEXT";
1862
+
string object_id = 1;
1865
+
string unique_id = 4;
1867
+
bool disabled_by_default = 6;
1868
+
EntityCategory entity_category = 7;
1870
+
uint32 min_length = 8;
1871
+
uint32 max_length = 9;
1872
+
string pattern = 10;
1873
+
TextMode mode = 11;
1874
+
uint32 device_id = 12;
1876
+
message TextStateResponse {
1878
+
option (base_class) = "StateResponseProtoMessage";
1879
+
option (source) = SOURCE_SERVER;
1880
+
option (ifdef) = "USE_TEXT";
1881
+
option (no_delay) = true;
1885
+
// If the Text does not have a valid state yet.
1886
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
1887
+
bool missing_state = 3;
1888
+
uint32 device_id = 4;
1890
+
message TextCommandRequest {
1892
+
option (source) = SOURCE_CLIENT;
1893
+
option (ifdef) = "USE_TEXT";
1894
+
option (no_delay) = true;
1901
+
// ==================== DATETIME DATE ====================
1902
+
message ListEntitiesDateResponse {
1903
+
option (id) = 100;
1904
+
option (base_class) = "InfoResponseProtoMessage";
1905
+
option (source) = SOURCE_SERVER;
1906
+
option (ifdef) = "USE_DATETIME_DATE";
1908
+
string object_id = 1;
1911
+
string unique_id = 4;
1914
+
bool disabled_by_default = 6;
1915
+
EntityCategory entity_category = 7;
1916
+
uint32 device_id = 8;
1918
+
message DateStateResponse {
1919
+
option (id) = 101;
1920
+
option (base_class) = "StateResponseProtoMessage";
1921
+
option (source) = SOURCE_SERVER;
1922
+
option (ifdef) = "USE_DATETIME_DATE";
1923
+
option (no_delay) = true;
1926
+
// If the date does not have a valid state yet.
1927
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
1928
+
bool missing_state = 2;
1932
+
uint32 device_id = 6;
1934
+
message DateCommandRequest {
1935
+
option (id) = 102;
1936
+
option (source) = SOURCE_CLIENT;
1937
+
option (ifdef) = "USE_DATETIME_DATE";
1938
+
option (no_delay) = true;
1946
+
// ==================== DATETIME TIME ====================
1947
+
message ListEntitiesTimeResponse {
1948
+
option (id) = 103;
1949
+
option (base_class) = "InfoResponseProtoMessage";
1950
+
option (source) = SOURCE_SERVER;
1951
+
option (ifdef) = "USE_DATETIME_TIME";
1953
+
string object_id = 1;
1956
+
string unique_id = 4;
1959
+
bool disabled_by_default = 6;
1960
+
EntityCategory entity_category = 7;
1961
+
uint32 device_id = 8;
1963
+
message TimeStateResponse {
1964
+
option (id) = 104;
1965
+
option (base_class) = "StateResponseProtoMessage";
1966
+
option (source) = SOURCE_SERVER;
1967
+
option (ifdef) = "USE_DATETIME_TIME";
1968
+
option (no_delay) = true;
1971
+
// If the time does not have a valid state yet.
1972
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
1973
+
bool missing_state = 2;
1975
+
uint32 minute = 4;
1976
+
uint32 second = 5;
1977
+
uint32 device_id = 6;
1979
+
message TimeCommandRequest {
1980
+
option (id) = 105;
1981
+
option (source) = SOURCE_CLIENT;
1982
+
option (ifdef) = "USE_DATETIME_TIME";
1983
+
option (no_delay) = true;
1987
+
uint32 minute = 3;
1988
+
uint32 second = 4;
1991
+
// ==================== EVENT ====================
1992
+
message ListEntitiesEventResponse {
1993
+
option (id) = 107;
1994
+
option (base_class) = "InfoResponseProtoMessage";
1995
+
option (source) = SOURCE_SERVER;
1996
+
option (ifdef) = "USE_EVENT";
1998
+
string object_id = 1;
2001
+
string unique_id = 4;
2004
+
bool disabled_by_default = 6;
2005
+
EntityCategory entity_category = 7;
2006
+
string device_class = 8;
2008
+
repeated string event_types = 9;
2009
+
uint32 device_id = 10;
2011
+
message EventResponse {
2012
+
option (id) = 108;
2013
+
option (base_class) = "StateResponseProtoMessage";
2014
+
option (source) = SOURCE_SERVER;
2015
+
option (ifdef) = "USE_EVENT";
2018
+
string event_type = 2;
2019
+
uint32 device_id = 3;
2022
+
// ==================== VALVE ====================
2023
+
message ListEntitiesValveResponse {
2024
+
option (id) = 109;
2025
+
option (base_class) = "InfoResponseProtoMessage";
2026
+
option (source) = SOURCE_SERVER;
2027
+
option (ifdef) = "USE_VALVE";
2029
+
string object_id = 1;
2032
+
string unique_id = 4;
2035
+
bool disabled_by_default = 6;
2036
+
EntityCategory entity_category = 7;
2037
+
string device_class = 8;
2039
+
bool assumed_state = 9;
2040
+
bool supports_position = 10;
2041
+
bool supports_stop = 11;
2042
+
uint32 device_id = 12;
2045
+
enum ValveOperation {
2046
+
VALVE_OPERATION_IDLE = 0;
2047
+
VALVE_OPERATION_IS_OPENING = 1;
2048
+
VALVE_OPERATION_IS_CLOSING = 2;
2050
+
message ValveStateResponse {
2051
+
option (id) = 110;
2052
+
option (base_class) = "StateResponseProtoMessage";
2053
+
option (source) = SOURCE_SERVER;
2054
+
option (ifdef) = "USE_VALVE";
2055
+
option (no_delay) = true;
2058
+
float position = 2;
2059
+
ValveOperation current_operation = 3;
2060
+
uint32 device_id = 4;
2063
+
message ValveCommandRequest {
2064
+
option (id) = 111;
2065
+
option (source) = SOURCE_CLIENT;
2066
+
option (ifdef) = "USE_VALVE";
2067
+
option (no_delay) = true;
2070
+
bool has_position = 2;
2071
+
float position = 3;
2075
+
// ==================== DATETIME DATETIME ====================
2076
+
message ListEntitiesDateTimeResponse {
2077
+
option (id) = 112;
2078
+
option (base_class) = "InfoResponseProtoMessage";
2079
+
option (source) = SOURCE_SERVER;
2080
+
option (ifdef) = "USE_DATETIME_DATETIME";
2082
+
string object_id = 1;
2085
+
string unique_id = 4;
2088
+
bool disabled_by_default = 6;
2089
+
EntityCategory entity_category = 7;
2090
+
uint32 device_id = 8;
2092
+
message DateTimeStateResponse {
2093
+
option (id) = 113;
2094
+
option (base_class) = "StateResponseProtoMessage";
2095
+
option (source) = SOURCE_SERVER;
2096
+
option (ifdef) = "USE_DATETIME_DATETIME";
2097
+
option (no_delay) = true;
2100
+
// If the datetime does not have a valid state yet.
2101
+
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
2102
+
bool missing_state = 2;
2103
+
fixed32 epoch_seconds = 3;
2104
+
uint32 device_id = 4;
2106
+
message DateTimeCommandRequest {
2107
+
option (id) = 114;
2108
+
option (source) = SOURCE_CLIENT;
2109
+
option (ifdef) = "USE_DATETIME_DATETIME";
2110
+
option (no_delay) = true;
2113
+
fixed32 epoch_seconds = 2;
2116
+
// ==================== UPDATE ====================
2117
+
message ListEntitiesUpdateResponse {
2118
+
option (id) = 116;
2119
+
option (base_class) = "InfoResponseProtoMessage";
2120
+
option (source) = SOURCE_SERVER;
2121
+
option (ifdef) = "USE_UPDATE";
2123
+
string object_id = 1;
2126
+
string unique_id = 4;
2129
+
bool disabled_by_default = 6;
2130
+
EntityCategory entity_category = 7;
2131
+
string device_class = 8;
2132
+
uint32 device_id = 9;
2134
+
message UpdateStateResponse {
2135
+
option (id) = 117;
2136
+
option (base_class) = "StateResponseProtoMessage";
2137
+
option (source) = SOURCE_SERVER;
2138
+
option (ifdef) = "USE_UPDATE";
2139
+
option (no_delay) = true;
2142
+
bool missing_state = 2;
2143
+
bool in_progress = 3;
2144
+
bool has_progress = 4;
2145
+
float progress = 5;
2146
+
string current_version = 6;
2147
+
string latest_version = 7;
2149
+
string release_summary = 9;
2150
+
string release_url = 10;
2151
+
uint32 device_id = 11;
2153
+
enum UpdateCommand {
2154
+
UPDATE_COMMAND_NONE = 0;
2155
+
UPDATE_COMMAND_UPDATE = 1;
2156
+
UPDATE_COMMAND_CHECK = 2;
2158
+
message UpdateCommandRequest {
2159
+
option (id) = 118;
2160
+
option (source) = SOURCE_CLIENT;
2161
+
option (ifdef) = "USE_UPDATE";
2162
+
option (no_delay) = true;
2165
+
UpdateCommand command = 2;