forked from FalconChristmas/fpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MQTT.txt
274 lines (251 loc) · 9.51 KB
/
MQTT.txt
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
FPP has the ability to both publish status via MQTT as well as receive commands by subscribing to specific topics.
Topic Format
---------------------------------------------
{optional prefix}/falcon/player/{hostname}/{sub_topic}
The {optional prefix} is defined in the advanced settings
The {hostname} is defined in the Network Settings tab and should be different for each FPP device on the network.
The {sub_topic} is outlined below...
FPP Publish subtopics
---------------------------------------------
FPP will published the following sub_topics (using the full topic format) if MQTT is configured
*/version -- The current full version of the fpp software
*/branch -- The git branch currently in use
*/status -- Status of the player (idle, playing)
*/warnings -- A JSON string that can be parsed into an Array of Warning messages.
*/playlist/position/status
*/playlist/name/status - Name of current playlist. Can be {null}.
*/playlist/repeat/status - {0 = not repeating current playlist, 1 = repeating current playlist}
*/playlist/section/status - either “New”, “LeadIn”, “MainPlayList”, “LeadOut”, or {null} if nothing playing
*/playlist/sectionPosition/status - The numeric position of the item currently playing in the playlist section (zero based)
*/playlist/sequence/status - Name of current sequence file playing. Can be {null}.
*/playlist/sequence/secondsTotal - The duration of the current sequence file playing, in seconds. Can be {null}.
*/playlist/media/title - Title of the audio / video media being displayed
*/playlist/media/status - filename of the current audio/movie
*/playlist/media/artist - The artist listing in the audio / video file being played
*/playlist_details - If the MQTT Playlist Publish Frequency option (Advanced settings) is > 0 then a JSON file is published based on the duration (seconds) specified.
*/fppd_status - If the MQTT Status Publish Frequency option (Advanced settings) is > 0 then a JSON file is published based on the duration (seconds) specified.
Message Example for fppd_status
---------------------------------------------
{
"MQTT":{
"configured":false,
"connected":false
},
"bridging":false,
"current_playlist":{
"count":"0",
"description":"",
"index":"0",
"playlist":"",
"type":""
},
"current_sequence":"",
"current_song":"",
"dateStr":"Sat Jan 21",
"fppd":"running",
"mode":2,
"mode_name":"player",
"multisync":false,
"next_playlist":{
"playlist":"No playlist scheduled.",
"start_time":""
},
"repeat_mode":"0",
"scheduler":{
"enabled":1,
"nextPlaylist":{
"playlistName":"No playlist scheduled.",
"scheduledStartTime":0,
"scheduledStartTimeStr":""
},
"status":"idle"
},
"seconds_played":"0",
"seconds_remaining":"0",
"sensors":[
{
"formatted":"51.0",
"label":"CPU: ",
"postfix":"",
"prefix":"",
"value":51.002,
"valueType":"Temperature"
}
],
"status":0,
"status_name":"idle",
"time":"Sat Jan 21 18:45:03 EST 2023",
"timeStr":"06:45 PM",
"timeStrFull":"06:45:03 PM",
"time_elapsed":"00:00",
"time_remaining":"00:00",
"uptime":"7 days, 06:51:26",
"uptimeDays":7.285717592592593,
"uptimeHours":6.857222222222222,
"uptimeMinutes":51.43333333333333,
"uptimeSeconds":26,
"uptimeStr":"7 days, 6 hours, 51 minutes, 26 seconds",
"uptimeTotalSeconds":629486,
"uuid":"M1-000000009c265065",
"volume":70,
"wifi":[
],
"interfaces":[
{
"ifindex":2,
"ifname":"wlan0",
"flags":[
"BROADCAST",
"MULTICAST"
],
"mtu":1500,
"qdisc":"noop",
"operstate":"DOWN",
"group":"default",
"txqlen":1000,
"link_type":"ether",
"address":"b8:27:eb:73:05:30",
"broadcast":"ff:ff:ff:ff:ff:ff",
"addr_info":[
]
},
{
"ifindex":3,
"ifname":"eth0",
"flags":[
"BROADCAST",
"MULTICAST",
"UP",
"LOWER_UP"
],
"mtu":1500,
"qdisc":"pfifo_fast",
"operstate":"UP",
"group":"default",
"txqlen":1000,
"link_type":"ether",
"address":"b8:27:eb:26:50:65",
"broadcast":"ff:ff:ff:ff:ff:ff",
"addr_info":[
{
"family":"inet",
"local":"192.168.1.146",
"prefixlen":24,
"broadcast":"192.168.1.255",
"scope":"global",
"dynamic":true,
"label":"eth0",
"valid_life_time":5062,
"preferred_life_time":5062
}
]
}
],
"rebootFlag":0,
"restartFlag":0,
"advancedView":{
"HostName":"FPPtest",
"HostDescription":"",
"Platform":"Raspberry Pi",
"Variant":"Pi 3 Model B",
"Mode":"player",
"Version":"6.x-master-659-g8a48f06f",
"Branch":"master",
"multisync":false,
"OSVersion":"v2022-11",
"OSRelease":"Raspbian GNU\/Linux 11 (bullseye)",
"channelRanges":"0-7",
"majorVersion":6,
"minorVersion":1000,
"typeId":8,
"uuid":"M1-000000009c265065",
"Utilization":{
"CPU":4.827586206896555,
"Memory":14.83697358389021,
"Uptime":"7 days",
"Disk":{
"Media":{
"Free":26331074560,
"Total":31109500928
},
"Root":{
"Free":26331074560,
"Total":31109500928
}
}
},
"Kernel":"5.15.74-v7+",
"LocalGitVersion":"8a48f06",
"RemoteGitVersion":"6a9abe4",
"UpgradeSource":"github.com",
"IPs":[
"192.168.1.146"
]
}
}
Message Example for playlist_details
---------------------------------------------
Note: Currently FPP only allows one active Playlist and for each Playlist, one active "item". However,
this will be increased in the future. Thus activePlaylist and currentItems return list of entries.
The sample currentItems below shows 3 records (one for the 3 most common types) but until concurrent
entries in a Playlist are allowed, only one will be displayed in real life.
{
"status" : "playing", // playing or idle
"activePlaylist" : [
{
"name" : "Name of current playlist",
"desc" : "Description of the PlayList",
"repeat" : 1, // 0 if playist is not repating, 1 if repeating
"currentItems" : [
{
"type": "both",
"sequenceName" : "Name of current sequence file playing.",
"mediaTitle" : "Title of the audio / video media being displayed",
"mediaName" : "filename of the current audio/movie",
"mediaArtist" : "The artist listing in the audio / video file being played",
"secondsRemaining" : 33,
"secondsTotal" : 54,
"secondsElapsed" : 21
},
{
"type": "sequence",
"sequenceName" : "Name of current sequence file playing.",
"secondsRemaining" : 33,
"secondsTotal" : 54,
"secondsElapsed" : 21
},
{
"type": "media",
"mediaTitle" : "Title of the audio / video media being displayed",
"mediaName" : "filename of the current audio/movie",
"mediaArtist" : "The artist listing in the audio / video file being played",
"secondsRemaining" : 33,
"secondsTotal" : 54,
"secondsElapsed" : 21
}
]
}
]
}
FPP Subscribed subtopics
---------------------------------------------
FPP will listen for these topics if MQTT is configured.
* playlist/ALLPLAYLISTS/stop/now - Immediate stop all running playlist
* playlist/ALLPLAYLISTS/stop/graceful - gracefully stop all running playlist
* playlist/ALLPLAYLISTS/stop/afterloop.- Allow playlist to finish current loop then stop.
There are also Playlist specific topics. Currently, ${PLAYLIST} is ignored for all but /start and will affect the current running playlist. In the future, when multiple concurrent playlist are running it will affect only the specified playlist.
* playlist/${PLAYLISTNAME}/start - Starts the playlist with the given name. (payload ignored)
* playlist/${PLAYLISTNAME}/next - Forces playing of the the next item in the playlist. (payload ignored)
* playlist/${PLAYLISTNAME}/prev - Forces playing of the previous item in the playlist (payload ignored)
* playlist/${PLAYLISTNAME}/repeat - Sets if the playlist will be repeated or terminate when done. (payload should be 0 or 1)
* playlist/${PLAYLISTNAME}/startPosition - Sets the item in the playlist (zero based) to play next. Does not immediately stop current item .
* playlist/${PLAYLISTNAME}/stop/now - Forces the playlist to stop immediately.
* playlist/${PLAYLISTNAME}/stop/graceful - gracefully stop playlist
* playlist/${PLAYLISTNAME}/stop/afterloop - Allow playlist to finish current loop then stop.
These are system commands for specific
* system/fppd/stop - Stops the fppd process (Will also kill the MQTT listener!)
* system/fppd/restart - Executes a Fast restart on the fppd process. (Reloads all settings.)
* system/shutdown - Shuts down the OS
* system/restart - Reboots the OS
It is possible to send command
* /set/command/${command} - Would run the specify command (any playload will be passed as if it was a REST API call)