-
Notifications
You must be signed in to change notification settings - Fork 15
/
samygo-api.yaml
138 lines (132 loc) · 3.99 KB
/
samygo-api.yaml
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
#This should be part of your HA configuration.yaml
#define sensors.
sensor:
- platform: rest
resource: !secret samygo_tv_living_channelinfo
method: GET
name: TV Living ChannelInfo
json_attributes:
- source
- pvr_status
- power_state
- tv_mode
- volume
- channel_number
- channel_name
- program_name
- resolution
scan_interval: '00:05'
- platform: template
sensors:
tv_living_source:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.source }}'
friendly_name: TV Living Source
tv_living_pvr_status:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.pvr_status }}'
friendly_name: TV Living PVR Status
tv_living_powerstate:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.power_state }}'
friendly_name: TV Living Power
tv_living_tv_mode:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.tv_mode }}'
friendly_name: TV Living TV Mode
tv_living_volume:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.volume }}'
friendly_name: TV Living Volume
tv_living_channel_number:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.channel_number }}'
friendly_name: TV Living Channel Number
tv_living_channel_name:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.channel_name }}'
friendly_name: TV Living Channel Name
tv_living_program_name:
value_template: '{{ states.sensor.tv_living_channelinfo.attributes.program_name }}'
friendly_name: TV Living Program Name
#remote control commands
rest_command:
tv_living_power_on:
url: !secret samygo_tv_living_power_on
tv_living_power_off:
url: !secret samygo_tv_living_power_off
tv_living_mute:
url: !secret samygo_tv_living_mute
tv_living_source:
url: !secret samygo_tv_living_source
tv_living_volume_up:
url: !secret samygo_tv_living_volume_up
tv_living_volume_down:
url: !secret samygo_tv_living_volume_down
tv_living_ch_up:
url: !secret samygo_tv_living_ch_up
tv_living_ch_down:
url: !secret samygo_tv_living_ch_down
tv_living_reboot:
url: !secret samygo_tv_living_reboot
script:
tv_living_power_on:
alias: Power on
sequence:
- service: rest_command.tv_living_power_on
tv_living_power_off:
alias: Power off
sequence:
- service: rest_command.tv_living_power_off
tv_living_mute:
alias: Mute
sequence:
- service: rest_command.tv_living_mute
tv_living_source:
alias: Source
sequence:
- service: rest_command.tv_living_source
tv_living_volume_up:
alias: Volume +
sequence:
- service: rest_command.tv_living_volume_up
tv_living_volume_down:
alias: Volume -
sequence:
- service: rest_command.tv_living_volume_down
tv_living_ch_up:
alias: CH +
sequence:
- service: rest_command.tv_living_ch_up
tv_living_ch_down:
alias: CH -
sequence:
- service: rest_command.tv_living_ch_down
#screenshot is using a camera entity
camera:
platform: generic
name: TV Living Image
still_image_url: !secret webcam_samygo_tv_living
#group TV data in one tab
group:
tv:
name: TV
view: yes
entities:
- group.tv_status
- camera.tv_living_image
- group.tv_remote
tv_status:
name: TV Status
entities:
- sensor.tv_living_powerstate
- sensor.tv_living_volume
- sensor.tv_living_tv_mode
- sensor.tv_living_source
- sensor.tv_living_channel_name
- sensor.tv_living_channel_number
- sensor.tv_living_program_name
tv_remote:
name: TV Remote
entities:
- script.tv_living_power_on
- script.tv_living_power_off
- script.tv_living_source
- script.tv_living_mute
- script.tv_living_volume_up
- script.tv_living_volume_down
- script.tv_living_ch_up
- script.tv_living_ch_down