-
Notifications
You must be signed in to change notification settings - Fork 1
/
supported-types.d.ts
2520 lines (2519 loc) · 89.8 KB
/
supported-types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// this is an auto generated file, do not change this manually
import {
ServiceFunction,
ServiceFunctionTypes,
VacuumEntityState,
} from "@hakit/core";
declare module "@hakit/core" {
export interface CustomSupportedServices<
T extends ServiceFunctionTypes = "target",
> {
persistentNotification: {
// Shows a notification on the notifications panel.
create: ServiceFunction<
T,
{
// Message body of the notification. @example Please check your configuration.yaml.
message: string;
// Optional title of the notification. @example Test notification
title?: string;
// ID of the notification. This new notification will overwrite an existing notification with the same ID. @example 1234
notification_id?: string;
}
>;
// Removes a notification from the notifications panel.
dismiss: ServiceFunction<
T,
{
// ID of the notification to be removed. @example 1234
notification_id: string;
}
>;
// Removes all notifications from the notifications panel.
dismissAll: ServiceFunction<T, object>;
};
homeassistant: {
// Saves the persistent states immediately. Maintains the normal periodic saving interval.
savePersistentStates: ServiceFunction<T, object>;
// Generic action to turn devices off under any domain.
turnOff: ServiceFunction<T, object>;
// Generic action to turn devices on under any domain.
turnOn: ServiceFunction<T, object>;
// Generic action to toggle devices on/off under any domain.
toggle: ServiceFunction<T, object>;
// Stops Home Assistant.
stop: ServiceFunction<T, object>;
// Restarts Home Assistant.
restart: ServiceFunction<T, object>;
// Checks the Home Assistant YAML-configuration files for errors. Errors will be shown in the Home Assistant logs.
checkConfig: ServiceFunction<T, object>;
// Forces one or more entities to update its data.
updateEntity: ServiceFunction<
T,
{
// List of entities to force update.
entity_id: string;
}
>;
// Reloads the core configuration from the YAML-configuration.
reloadCoreConfig: ServiceFunction<T, object>;
// Updates the Home Assistant location.
setLocation: ServiceFunction<
T,
{
// Latitude of your location. @example 32.87336
latitude: number;
// Longitude of your location. @example 117.22743
longitude: number;
// Elevation of your location. @example 120
elevation?: number;
}
>;
// Reloads Jinja2 templates found in the `custom_templates` folder in your config. New values will be applied on the next render of the template.
reloadCustomTemplates: ServiceFunction<T, object>;
// Reloads the specified config entry.
reloadConfigEntry: ServiceFunction<
T,
{
// The configuration entry ID of the entry to be reloaded. @example 8955375327824e14ba89e4b29cc3ec9a
entry_id?: string;
}
>;
// Reload all YAML configuration that can be reloaded without restarting Home Assistant.
reloadAll: ServiceFunction<T, object>;
};
systemLog: {
// Clears all log entries.
clear: ServiceFunction<T, object>;
// Write log entry.
write: ServiceFunction<
T,
{
// Message to log. @example Something went wrong
message: string;
// Log level.
level?: "debug" | "info" | "warning" | "error" | "critical";
// Logger name under which to log the message. Defaults to `system_log.external`. @example mycomponent.myplatform
logger?: string;
}
>;
};
logger: {
// Sets the default log level for integrations.
setDefaultLevel: ServiceFunction<
T,
{
// Default severity level for all integrations.
level?: "debug" | "info" | "warning" | "error" | "fatal" | "critical";
}
>;
// Sets the log level for one or more integrations.
setLevel: ServiceFunction<T, object>;
};
person: {
// Reloads persons from the YAML-configuration.
reload: ServiceFunction<T, object>;
};
frontend: {
// Sets the default theme Home Assistant uses. Can be overridden by a user.
setTheme: ServiceFunction<
T,
{
// Name of a theme. @example default
name: object;
// Theme mode.
mode?: "dark" | "light";
}
>;
// Reloads themes from the YAML-configuration.
reloadThemes: ServiceFunction<T, object>;
};
recorder: {
// Starts purge task - to clean up old data from your database.
purge: ServiceFunction<
T,
{
// Number of days to keep the data in the database. Starting today, counting backward. A value of `7` means that everything older than a week will be purged.
keep_days?: number;
// Attempt to save disk space by rewriting the entire database file.
repack?: boolean;
// Apply `entity_id` and `event_type` filters in addition to time-based purge.
apply_filter?: boolean;
}
>;
// Starts a purge task to remove the data related to specific entities from your database.
purgeEntities: ServiceFunction<
T,
{
// List of entities for which the data is to be removed from the recorder database.
entity_id?: string;
// List of domains for which the data needs to be removed from the recorder database. @example sun
domains?: object;
// List of glob patterns used to select the entities for which the data is to be removed from the recorder database. @example domain*.object_id*
entity_globs?: object;
// Number of days to keep the data for rows matching the filter. Starting today, counting backward. A value of `7` means that everything older than a week will be purged. The default of 0 days will remove all matching rows immediately.
keep_days?: number;
}
>;
// Starts the recording of events and state changes.
enable: ServiceFunction<T, object>;
// Stops the recording of events and state changes.
disable: ServiceFunction<T, object>;
};
hassio: {
// Starts an add-on.
addonStart: ServiceFunction<
T,
{
// The add-on slug. @example core_ssh
addon: object;
}
>;
// Stops an add-on.
addonStop: ServiceFunction<
T,
{
// The add-on slug. @example core_ssh
addon: object;
}
>;
// Restarts an add-on.
addonRestart: ServiceFunction<
T,
{
// The add-on slug. @example core_ssh
addon: object;
}
>;
// Updates an add-on. This action should be used with caution since add-on updates can contain breaking changes. It is highly recommended that you review release notes/change logs before updating an add-on.
addonUpdate: ServiceFunction<
T,
{
// The add-on slug. @example core_ssh
addon: object;
}
>;
// Writes data to add-on stdin.
addonStdin: ServiceFunction<
T,
{
// The add-on slug. @example core_ssh
addon: object;
}
>;
// Powers off the host system.
hostShutdown: ServiceFunction<T, object>;
// Reboots the host system.
hostReboot: ServiceFunction<T, object>;
// Creates a full backup.
backupFull: ServiceFunction<
T,
{
// Optional (default = current date and time). @example Backup 1
name?: string;
// Password to protect the backup with. @example password
password?: string;
// Compresses the backup files.
compressed?: boolean;
// Name of a backup network storage to host backups. @example my_backup_mount
location?: object;
// Exclude the Home Assistant database file from backup
homeassistant_exclude_database?: boolean;
}
>;
// Creates a partial backup.
backupPartial: ServiceFunction<
T,
{
// Includes Home Assistant settings in the backup.
homeassistant?: boolean;
// Exclude the Home Assistant database file from backup
homeassistant_exclude_database?: boolean;
// List of add-ons to include in the backup. Use the name slug of the add-on. @example core_ssh,core_samba,core_mosquitto
addons?: object;
// List of directories to include in the backup. @example homeassistant,share
folders?: object;
// Optional (default = current date and time). @example Partial backup 1
name?: string;
// Password to protect the backup with. @example password
password?: string;
// Compresses the backup files.
compressed?: boolean;
// Name of a backup network storage to host backups. @example my_backup_mount
location?: object;
}
>;
// Restores from full backup.
restoreFull: ServiceFunction<
T,
{
// Slug of backup to restore from.
slug: string;
// Optional password. @example password
password?: string;
}
>;
// Restores from a partial backup.
restorePartial: ServiceFunction<
T,
{
// Slug of backup to restore from.
slug: string;
// Restores Home Assistant.
homeassistant?: boolean;
// List of directories to include in the backup. @example homeassistant,share
folders?: object;
// List of add-ons to include in the backup. Use the name slug of the add-on. @example core_ssh,core_samba,core_mosquitto
addons?: object;
// Optional password. @example password
password?: string;
}
>;
};
update: {
// Installs an update for this device or service.
install: ServiceFunction<
T,
{
// The version to install. If omitted, the latest version will be installed. @example 1.0.0
version?: string;
// If supported by the integration, this creates a backup before starting the update .
backup?: boolean;
}
>;
// Marks currently available update as skipped.
skip: ServiceFunction<T, object>;
// Removes the skipped version marker from an update.
clearSkipped: ServiceFunction<T, object>;
};
cloud: {
// Makes the instance UI accessible from outside of the local network by using Home Assistant Cloud.
remoteConnect: ServiceFunction<T, object>;
// Disconnects the Home Assistant UI from the Home Assistant Cloud. You will no longer be able to access your Home Assistant instance from outside your local network.
remoteDisconnect: ServiceFunction<T, object>;
};
ffmpeg: {
// Sends a start command to a ffmpeg based sensor.
start: ServiceFunction<
T,
{
// Name of entity that will start. Platform dependent.
entity_id?: string;
}
>;
// Sends a stop command to a ffmpeg based sensor.
stop: ServiceFunction<
T,
{
// Name of entity that will stop. Platform dependent.
entity_id?: string;
}
>;
// Sends a restart command to a ffmpeg based sensor.
restart: ServiceFunction<
T,
{
// Name of entity that will restart. Platform dependent.
entity_id?: string;
}
>;
};
tts: {
// Speaks something using text-to-speech on a media player.
speak: ServiceFunction<
T,
{
// Media players to play the message.
media_player_entity_id: string;
// The text you want to convert into speech so that you can listen to it on your device. @example My name is hanna
message: string;
// Stores this message locally so that when the text is requested again, the output can be produced more quickly.
cache?: boolean;
// Language to use for speech generation. @example ru
language?: string;
// A dictionary containing integration-specific options. @example platform specific
options?: object;
}
>;
// Removes all cached text-to-speech files and purges the memory.
clearCache: ServiceFunction<T, object>;
// Say something using text-to-speech on a media player with cloud.
cloudSay: ServiceFunction<
T,
{
// undefined
entity_id: string;
// undefined @example My name is hanna
message: string;
// undefined
cache?: boolean;
// undefined @example ru
language?: string;
// undefined @example platform specific
options?: object;
}
>;
// Say something using text-to-speech on a media player with google_translate.
googleTranslateSay: ServiceFunction<
T,
{
// undefined
entity_id: string;
// undefined @example My name is hanna
message: string;
// undefined
cache?: boolean;
// undefined @example ru
language?: string;
// undefined @example platform specific
options?: object;
}
>;
};
group: {
// Reloads group configuration, entities, and notify services from YAML-configuration.
reload: ServiceFunction<T, object>;
// Creates/Updates a user group.
set: ServiceFunction<
T,
{
// Object ID of this group. This object ID is used as part of the entity ID. Entity ID format: [domain].[object_id]. @example test_group
object_id: string;
// Name of the group. @example My test group
name?: string;
// Name of the icon for the group. @example mdi:camera
icon?: object;
// List of all members in the group. Cannot be used in combination with `Add entities` or `Remove entities`. @example domain.entity_id1, domain.entity_id2
entities?: string;
// List of members to be added to the group. Cannot be used in combination with `Entities` or `Remove entities`. @example domain.entity_id1, domain.entity_id2
add_entities?: string;
// List of members to be removed from a group. Cannot be used in combination with `Entities` or `Add entities`. @example domain.entity_id1, domain.entity_id2
remove_entities?: string;
// Enable this option if the group should only be used when all entities are in state `on`.
all?: boolean;
}
>;
// Removes a group.
remove: ServiceFunction<
T,
{
// Object ID of this group. This object ID is used as part of the entity ID. Entity ID format: [domain].[object_id]. @example test_group
object_id: object;
}
>;
};
mediaPlayer: {
// Turns on the power of the media player.
turnOn: ServiceFunction<T, object>;
// Turns off the power of the media player.
turnOff: ServiceFunction<T, object>;
// Toggles a media player on/off.
toggle: ServiceFunction<T, object>;
// Turns up the volume.
volumeUp: ServiceFunction<T, object>;
// Turns down the volume.
volumeDown: ServiceFunction<T, object>;
// Toggles play/pause.
mediaPlayPause: ServiceFunction<T, object>;
// Starts playing.
mediaPlay: ServiceFunction<T, object>;
// Pauses.
mediaPause: ServiceFunction<T, object>;
// Stops playing.
mediaStop: ServiceFunction<T, object>;
// Selects the next track.
mediaNextTrack: ServiceFunction<T, object>;
// Selects the previous track.
mediaPreviousTrack: ServiceFunction<T, object>;
// Clears the playlist.
clearPlaylist: ServiceFunction<T, object>;
// Sets the volume level.
volumeSet: ServiceFunction<
T,
{
// The volume. 0 is inaudible, 1 is the maximum volume.
volume_level: number;
}
>;
// Mutes or unmutes the media player.
volumeMute: ServiceFunction<
T,
{
// Defines whether or not it is muted.
is_volume_muted: boolean;
}
>;
// Allows you to go to a different part of the media that is currently playing.
mediaSeek: ServiceFunction<
T,
{
// Target position in the currently playing media. The format is platform dependent.
seek_position: number;
}
>;
// Groups media players together for synchronous playback. Only works on supported multiroom audio systems.
join: ServiceFunction<
T,
{
// The players which will be synced with the playback specified in `target`. @example - media_player.multiroom_player2 - media_player.multiroom_player3
group_members: string[];
}
>;
// Sends the media player the command to change input source.
selectSource: ServiceFunction<
T,
{
// Name of the source to switch to. Platform dependent. @example video1
source: string;
}
>;
// Selects a specific sound mode.
selectSoundMode: ServiceFunction<
T,
{
// Name of the sound mode to switch to. @example Music
sound_mode?: string;
}
>;
// Starts playing specified media.
playMedia: ServiceFunction<
T,
{
// The ID of the content to play. Platform dependent. @example https://home-assistant.io/images/cast/splash.png
media_content_id: string | number;
// The type of the content to play. Such as image, music, tv show, video, episode, channel, or playlist. @example music
media_content_type: string;
// If the content should be played now or be added to the queue.
enqueue?: "play" | "next" | "add" | "replace";
// If the media should be played as an announcement. @example true
announce?: boolean;
}
>;
// Playback mode that selects the media in randomized order.
shuffleSet: ServiceFunction<
T,
{
// Whether or not shuffle mode is enabled.
shuffle: boolean;
}
>;
// Removes the player from a group. Only works on platforms which support player groups.
unjoin: ServiceFunction<T, object>;
// Playback mode that plays the media in a loop.
repeatSet: ServiceFunction<
T,
{
// Repeat mode to set.
repeat: "off" | "all" | "one";
}
>;
};
light: {
// Turn on one or more lights and adjust properties of the light, even when they are turned on already.
turnOn: ServiceFunction<
T,
{
// Duration it takes to get to next state.
transition?: number;
// The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. @example [255, 100, 100]
rgb_color?: [number, number, number];
// Color temperature in Kelvin.
kelvin?: number | object;
// Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness.
brightness_pct?: number;
// Change brightness by a percentage.
brightness_step_pct?: number;
// Light effect.
effect?: string;
// undefined
advanced_fields?: object;
}
>;
// Turn off one or more lights.
turnOff: ServiceFunction<
T,
{
// Duration it takes to get to next state.
transition?: number;
// undefined
advanced_fields?: object;
}
>;
// Toggles one or more lights, from on to off, or, off to on, based on their current state.
toggle: ServiceFunction<
T,
{
// Duration it takes to get to next state.
transition?: number;
// The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. @example [255, 100, 100]
rgb_color?: [number, number, number];
// Color temperature in Kelvin.
kelvin?: number | object;
// Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness.
brightness_pct?: number;
// Light effect.
effect?: string;
// undefined
advanced_fields?: object;
}
>;
};
scene: {
// Activates a scene.
turnOn: ServiceFunction<
T,
{
// Time it takes the devices to transition into the states defined in the scene.
transition?: number;
}
>;
// Reloads the scenes from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Activates a scene with configuration.
apply: ServiceFunction<
T,
{
// List of entities and their target state. @example light.kitchen: 'on' light.ceiling: state: 'on' brightness: 80
entities: object;
// Time it takes the devices to transition into the states defined in the scene.
transition?: number;
}
>;
// Creates a new scene.
create: ServiceFunction<
T,
{
// The entity ID of the new scene. @example all_lights
scene_id: string;
// List of entities and their target state. If your entities are already in the target state right now, use `snapshot_entities` instead. @example light.tv_back_light: 'on' light.ceiling: state: 'on' brightness: 200
entities?: object;
// List of entities to be included in the snapshot. By taking a snapshot, you record the current state of those entities. If you do not want to use the current state of all your entities for this scene, you can combine the `snapshot_entities` with `entities`. @example - light.ceiling - light.kitchen
snapshot_entities?: string;
}
>;
// Deletes a dynamically created scene.
delete: ServiceFunction<T, object>;
};
logbook: {
// Creates a custom entry in the logbook.
log: ServiceFunction<
T,
{
// Custom name for an entity, can be referenced using an `entity_id`. @example Kitchen
name: string;
// Message of the logbook entry. @example is being used
message: string;
// Entity to reference in the logbook entry.
entity_id?: string;
// Determines which icon is used in the logbook entry. The icon illustrates the integration domain related to this logbook entry. @example light
domain?: string;
}
>;
};
inputNumber: {
// Reloads helpers from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Sets the value.
setValue: ServiceFunction<
T,
{
// The target value.
value: number;
}
>;
// Increments the value by 1 step.
increment: ServiceFunction<T, object>;
// Decrements the current value by 1 step.
decrement: ServiceFunction<T, object>;
};
inputButton: {
// Reloads helpers from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Mimics the physical button press on the device.
press: ServiceFunction<T, object>;
};
script: {
//
gamingLightColorChanger: ServiceFunction<T, object>;
//
randomLightColour: ServiceFunction<T, object>;
//
saySomething: ServiceFunction<T, object>;
// Reloads all the available scripts.
reload: ServiceFunction<T, object>;
// Runs the sequence of actions defined in a script.
turnOn: ServiceFunction<T, object>;
// Stops a running script.
turnOff: ServiceFunction<T, object>;
// Toggle a script. Starts it, if isn't running, stops it otherwise.
toggle: ServiceFunction<T, object>;
};
inputSelect: {
// Reloads helpers from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Selects the first option.
selectFirst: ServiceFunction<T, object>;
// Selects the last option.
selectLast: ServiceFunction<T, object>;
// Select the next option.
selectNext: ServiceFunction<
T,
{
// If the option should cycle from the last to the first option on the list.
cycle?: boolean;
}
>;
// Selects an option.
selectOption: ServiceFunction<
T,
{
// Option to be selected. @example 'Item A'
option: string;
}
>;
// Selects the previous option.
selectPrevious: ServiceFunction<
T,
{
// If the option should cycle from the last to the first option on the list.
cycle?: boolean;
}
>;
// Sets the options.
setOptions: ServiceFunction<
T,
{
// List of options. @example ['Item A', 'Item B', 'Item C']
options: string;
}
>;
};
zone: {
// Reloads zones from the YAML-configuration.
reload: ServiceFunction<T, object>;
};
historyStats: {
// Reloads history stats sensors from the YAML-configuration.
reload: ServiceFunction<T, object>;
};
timer: {
// Reloads timers from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Starts a timer.
start: ServiceFunction<
T,
{
// Duration the timer requires to finish. [optional]. @example 00:01:00 or 60
duration?: string;
}
>;
// Pauses a timer.
pause: ServiceFunction<T, object>;
// Cancels a timer.
cancel: ServiceFunction<T, object>;
// Finishes a timer.
finish: ServiceFunction<T, object>;
// Changes a timer.
change: ServiceFunction<
T,
{
// Duration to add or subtract to the running timer. @example 00:01:00, 60 or -60
duration: string;
}
>;
};
inputBoolean: {
// Reloads helpers from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Turns on the helper.
turnOn: ServiceFunction<T, object>;
// Turns off the helper.
turnOff: ServiceFunction<T, object>;
// Toggles the helper on/off.
toggle: ServiceFunction<T, object>;
};
switch: {
// Turns a switch off.
turnOff: ServiceFunction<T, object>;
// Turns a switch on.
turnOn: ServiceFunction<T, object>;
// Toggles a switch on/off.
toggle: ServiceFunction<T, object>;
};
cover: {
// Opens a cover.
openCover: ServiceFunction<T, object>;
// Closes a cover.
closeCover: ServiceFunction<T, object>;
// Moves a cover to a specific position.
setCoverPosition: ServiceFunction<
T,
{
// Target position.
position: number;
}
>;
// Stops the cover movement.
stopCover: ServiceFunction<T, object>;
// Toggles a cover open/closed.
toggle: ServiceFunction<T, object>;
// Tilts a cover open.
openCoverTilt: ServiceFunction<T, object>;
// Tilts a cover to close.
closeCoverTilt: ServiceFunction<T, object>;
// Stops a tilting cover movement.
stopCoverTilt: ServiceFunction<T, object>;
// Moves a cover tilt to a specific position.
setCoverTiltPosition: ServiceFunction<
T,
{
// Target tilt positition.
tilt_position: number;
}
>;
// Toggles a cover tilt open/closed.
toggleCoverTilt: ServiceFunction<T, object>;
};
conversation: {
// Launches a conversation from a transcribed text.
process: ServiceFunction<
T,
{
// Transcribed text input. @example Turn all lights on
text: string;
// Language of text. Defaults to server language. @example NL
language?: string;
// Conversation agent to process your request. The conversation agent is the brains of your assistant. It processes the incoming text commands. @example homeassistant
agent_id?: object;
// ID of the conversation, to be able to continue a previous conversation @example my_conversation_1
conversation_id?: string;
}
>;
// Reloads the intent configuration.
reload: ServiceFunction<
T,
{
// Language to clear cached intents for. Defaults to server language. @example NL
language?: string;
// Conversation agent to reload. @example homeassistant
agent_id?: object;
}
>;
};
profiler: {
// Starts the Profiler.
start: ServiceFunction<
T,
{
// The number of seconds to run the profiler.
seconds?: number;
}
>;
// Starts the Memory Profiler.
memory: ServiceFunction<
T,
{
// The number of seconds to run the memory profiler.
seconds?: number;
}
>;
// Starts logging growth of objects in memory.
startLogObjects: ServiceFunction<
T,
{
// The number of seconds between logging objects.
scan_interval?: number;
}
>;
// Stops logging growth of objects in memory.
stopLogObjects: ServiceFunction<T, object>;
// Starts logging sources of new objects in memory.
startLogObjectSources: ServiceFunction<
T,
{
// The number of seconds between logging objects.
scan_interval?: number;
// The maximum number of objects to log.
max_objects?: number;
}
>;
// Stops logging sources of new objects in memory.
stopLogObjectSources: ServiceFunction<T, object>;
// Dumps the repr of all matching objects to the log.
dumpLogObjects: ServiceFunction<
T,
{
// The type of objects to dump to the log. @example State
type: string;
}
>;
// Logs the stats of all lru caches.
lruStats: ServiceFunction<T, object>;
// Logs the current frames for all threads.
logThreadFrames: ServiceFunction<T, object>;
// Logs what is scheduled in the event loop.
logEventLoopScheduled: ServiceFunction<T, object>;
// Enable or disable asyncio debug.
setAsyncioDebug: ServiceFunction<
T,
{
// Whether to enable or disable asyncio debug.
enabled?: boolean;
}
>;
// Logs all the current asyncio tasks.
logCurrentTasks: ServiceFunction<T, object>;
};
restCommand: {
//
assistantRelay: ServiceFunction<T, object>;
// Reloads RESTful commands from the YAML-configuration.
reload: ServiceFunction<T, object>;
};
counter: {
// Increments a counter.
increment: ServiceFunction<T, object>;
// Decrements a counter.
decrement: ServiceFunction<T, object>;
// Resets a counter.
reset: ServiceFunction<T, object>;
// Sets the counter value.
setValue: ServiceFunction<
T,
{
// The new counter value the entity should be set to.
value: number;
}
>;
};
inputDatetime: {
// Reloads helpers from the YAML-configuration.
reload: ServiceFunction<T, object>;
// Sets the date and/or time.
setDatetime: ServiceFunction<
T,
{
// The target date. @example '2019-04-20'
date?: string;
// The target time. @example '05:04:20'
time?: object;
// The target date & time. @example '2019-04-20 05:04:20'
datetime?: string;
// The target date & time, expressed by a UNIX timestamp.
timestamp?: number;
}
>;
};
localtuya: {
// Reload localtuya and reconnect to all devices.
reload: ServiceFunction<T, object>;
// Change the value of a datapoint (DP)
setDp: ServiceFunction<
T,
{
// Device ID of device to change datapoint value for @example 11100118278aab4de001
device_id?: object;
// Datapoint index @example 1
dp?: object;
// New value to set
value?: object;
}
>;
};
cast: {
// Shows a dashboard view on a Chromecast device.
showLovelaceView: ServiceFunction<
T,
{
// Media player entity to show the dashboard view on.
entity_id: string;
// The URL path of the dashboard to show. @example lovelace-cast
dashboard_path: string;
// The path of the dashboard view to show. @example downstairs
view_path?: string;
}
>;
};
reolink: {
// Play a ringtone on a chime.
playChime: ServiceFunction<
T,
{
// The chime to play the ringtone on.
device_id: object;
// Ringtone to play.
ringtone:
| "citybird"
| "originaltune"
| "pianokey"
| "loop"
| "attraction"
| "hophop"
| "goodday"
| "operetta"
| "moonlight"
| "waybackhome";
}
>;
// Move the camera with a specific speed.
ptzMove: ServiceFunction<
T,
{
// PTZ move speed.
speed: number;
}
>;
};
schedule: {
// Reloads schedules from the YAML-configuration.
reload: ServiceFunction<T, object>;
};
select: {
// Selects the first option.
selectFirst: ServiceFunction<T, object>;
// Selects the last option.
selectLast: ServiceFunction<T, object>;
// Selects the next option.
selectNext: ServiceFunction<
T,
{
// If the option should cycle from the last to the first.
cycle?: boolean;
}
>;
// Selects an option.
selectOption: ServiceFunction<
T,
{
// Option to be selected. @example 'Item A'
option: string;
}
>;
// Selects the previous option.
selectPrevious: ServiceFunction<
T,
{
// If the option should cycle from the first to the last.
cycle?: boolean;
}
>;