Advanced Command & Feedback Reference
This page explains how commands, responses, query timing and UI feedback parsing work inside MyURemote.
MyURemote is not command-driven. It is a response-driven execution system. Commands trigger communication. Responses determine UI state.
A command can work perfectly on the network while the UI still shows nothing. In that case, the transport is usually correct and the feedback parsing is wrong.
Contents
1. The real execution model 2. Action commands vs query commands 3. Which queries are called by the UI? 4. Feedback fields used by MyURemote 5. The feedback parser model 6. StopSign rules 7. Hex, text and escaped values 8. HEOS example: title, artist, station, volume 9. What OK really means 10. Troubleshooting checklist1. The real execution model
UI action → sendCommandFromDevice() → extender.executeCommand() → localhost gateway → socket / websocket / secure transport → device → raw response → AnalyseFeedback() → display_line update
2. Action commands vs query commands
Action command
PLAY → player/set_play_state?pid={pid}&state=play
- Changes device state.
- May return only success or nothing useful.
- Does not automatically update title, artist, volume or power state.
Query command
TITLE QUERY → player/get_now_playing_media?pid={pid}
- Requests current device state.
- Returns raw data.
- Feeds
AnalyseFeedback().
3. Which queries are called by the UI?
MyURemote does not continuously run every possible query. The active zone, input and enabled feedback flags determine which queries are called.
Main scheduler
fnQueryState() → fnQueryStateAmplifier() immediately → fnQueryRow1() after 2 seconds → fnQueryStateAmplifier() after 3 seconds → fnQueryRow2() after 5 seconds → fnQueryStateAmplifier() after 6 seconds → fnQueryRow3() after 8 seconds → fnQueryStateAmplifier() after 9 seconds → fnQueryRow4() after 11 seconds
Amplifier queries
| Function | Command name | Feedback function | Purpose |
|---|---|---|---|
fnQueryStateAmplifier() |
SRC QUERY |
GetFeedbackSRC() |
Detect amplifier input/source. |
fnQueryStatePWR() |
PWR QUERY |
GetFeedbackPWR() |
Detect amplifier power state. |
fnQueryStateVolume() |
Vol QUERY |
GetFeedbackVolume() |
Read volume and update volume display. |
Current input device queries
| Function | Command name | Feedback variables | Purpose |
|---|---|---|---|
fnQueryTitle() |
TITLE QUERY |
TitlePrefix, TitleHex, TitlePos, TitleDig, TitleStopSign |
Read title/song name and update display line 3 and 6. |
fnQueryArtist() |
ARTIST QUERY |
ArtistPrefix, ArtistHex, ArtistPos, ArtistDig, ArtistStopSign |
Read artist name and update display line 3 and 6. |
fnQueryStation() |
STATION QUERY |
StationPrefix, StationHex, StationPos, StationDig, StationStopSign |
Read station/source name and update display line 3 and 6. |
fnQueryAmpDispInfo() |
DISPINFO QUERY |
DispInfoPrefix, DispInfoHex, DispInfoPos, DispInfoDig, DispInfoStopSign |
Read display information from the amplifier. |
fnQueryStateRDS() |
RDS QUERY |
rdsPrefix, rdsHex, rdsPos, rdsDig, rdsStopSign |
Read FM/RDS text. |
devices.js. For example, TITLE QUERY is not magic. It is a configured command that is sent to the current input device.
4. Feedback fields used by MyURemote
Each feedback type has its own command and parsing settings. The parser does not know what a title, artist or volume is. It only receives a raw response and extraction rules.
| UI value | Query command | Prefix setting | StopSign setting | Hex setting |
|---|---|---|---|---|
| Volume | Vol QUERY |
VOL Prefix |
VOL StopSign |
VOL Hex |
| Power | PWR QUERY |
PWR Prefix |
PWR StopSign |
PWR Hex |
| Source | SRC QUERY |
SRC Prefix |
SRC StopSign |
SRC Hex |
| Title | TITLE QUERY |
TITLE PREFIX |
TITLE STOPSIGN |
TITLE HEX |
| Artist | ARTIST QUERY |
ARTIST PREFIX |
ARTIST STOPSIGN |
ARTIST HEX |
| Station | STATION QUERY |
STATION PREFIX |
STATION STOPSIGN |
STATION HEX |
5. The feedback parser model
The generic parser is AnalyseFeedback(response, Prefix, Hex, Position, Digits, StopSign, WhatFeedback).
Meaning of each setting
| Setting | Meaning | Typical value |
|---|---|---|
| Prefix | Text that appears before the value. | level=, song, artist |
| Position | Extra offset after the prefix. | 0, 3, 4, 5 |
| Digits | Maximum or fixed length when no stopsign is found. | 1, 2, 50 |
| StopSign | Marker where the value ends. | &, \x22\x2C, , |
| Hex | Whether the response must be interpreted as hex/binary. | false for JSON/text, true for binary/hex protocols. |
Text extraction logic
value starts at: indexOf(Prefix) + Prefix.length + Position value ends at: StopSign if StopSign is empty or not usable: Digits is used
Position is not an absolute position in the response. It is an offset after the prefix.
6. StopSign rules
StopSign is the marker that tells MyURemote where the extracted value ends. It is often more important than Digits.
Common StopSigns
| Situation | Response example | StopSign | Notes |
|---|---|---|---|
| URL-style message | level=13&mute=off |
& |
Stops before the next parameter. |
| Normal JSON string | "song":"Re-Rewind","station": |
", |
Stops before the closing quote and comma. |
| Escaped JSON string | \"song\":\"Re-Rewind\",\"station\": |
\x22\x2C |
Safer when quotes cannot be stored directly in devices.js. |
| Fixed-length numeric value | level=13 |
empty | Use Digits, for example 2. |
Important ASCII / HEX references
| Character | Meaning | Decimal | Hex | Escaped form |
|---|---|---|---|---|
" | double quote | 34 | 22 | \x22 |
, | comma | 44 | 2C | \x2C |
& | ampersand | 38 | 26 | \x26 |
: | colon | 58 | 3A | \x3A |
\ | backslash | 92 | 5C | \x5C |
" in a command or setting when it breaks the generated JavaScript. Use the escaped form, such as \x22, when the configuration is exported to devices.js.
7. Hex, text and escaped values
Text / JSON response
{"heos":{"message":"pid=123&level=13"}}
Use Hex = false. Extract with Prefix, Position and StopSign.
Pure hex string response
1b920318080210021a
Use hex parsing only when the response is actually a hex string or binary protocol data.
Binary / raw byte response
\x02\x01\xFF
Some protocols return non-printable bytes. In that case MyURemote may convert the raw string to bytes before parsing.
8. HEOS example: title, artist, station, volume
HEOS is a good example because the command succeeds, but the display only works when the response is parsed correctly.
HEOS transport commands
| Action | Command |
|---|---|
| Play | player/set_play_state?pid={pid}&state=play |
| Pause | player/set_play_state?pid={pid}&state=pause |
| Stop | player/set_play_state?pid={pid}&state=stop |
| Next | player/play_next?pid={pid} |
| Previous | player/play_previous?pid={pid} |
| Volume query | player/get_volume?pid={pid} |
| Now playing query | player/get_now_playing_media?pid={pid} |
| Play state query | player/get_play_state?pid={pid} |
HEOS volume response
{"heos":{"command":"player/get_volume","result":"success","message":"pid=123&level=13"}}
| Setting | Value | Reason |
|---|---|---|
| VOL Prefix | level= | Value starts after level=. |
| VOL Position | 0 | No extra offset needed. |
| VOL Digits | 2 | HEOS volume can be one or two digits. |
| VOL StopSign | \x26 or empty | \x26 is &. Empty also works when Digits is enough. |
| VOL Hex | false | HEOS is text/JSON. |
HEOS now playing response
{"heos":{"command":"player/get_now_playing_media","result":"success"},"payload":{"type":"station","song":"Re-Rewind","station":"Nostalgie 90's & 00's","album":"","artist":"Artful Dodger"}}
Recommended HEOS text settings when the response remains escaped
This is recommended when raw quotes cannot safely be stored in devices.js.
| Field | Prefix | Position | Digits | StopSign | Hex |
|---|---|---|---|---|---|
| Title | song | 5 | 50 | \x22\x2C | false |
| Artist | artist | 5 | 50 | \x22 | false |
| Station | station | 5 | 50 | \x22\x2C | false |
Position = 5? In escaped JSON, after song comes \":\". That is five characters: backslash, quote, colon, backslash, quote.
Alternative HEOS settings when quotes are unescaped
If heos.js converts \" to ", then the response becomes normal JSON text. In that case use:
| Field | Prefix | Position | Digits | StopSign | Hex |
|---|---|---|---|---|---|
| Title | song | 3 | 50 | ", | false |
| Artist | artist | 3 | 50 | " | false |
| Station | station | 3 | 50 | ", | false |
\x22-style stopsigns, or unescape HEOS and use normal text stopsigns. Mixing both causes off-by-one and wrong-stop problems.
HEOS play state as power status
player/get_play_state?pid={pid}
HEOS does not provide a classic amplifier power state. For UI purposes, play state can be used as a logical power/activity state.
| HEOS state | Suggested MyURemote meaning |
|---|---|
play | On / active |
pause | On / active but paused |
stop | Stopped / inactive |
9. What OK really means
OK only means:
- The gateway accepted the request.
- The connection/write probably succeeded.
It does not mean:
- The device executed the command.
- The device state changed.
- The UI has enough data to update.
10. Troubleshooting checklist
| Symptom | Likely cause | What to check |
|---|---|---|
| Command works but display does not update | Feedback parser mismatch | Raw response, Prefix, Position, StopSign, Hex. |
| Only first characters appear | StopSign matches too early | Use a more specific StopSign, for example \x22\x2C instead of only \x22. |
Value includes ", |
Substring includes the StopSign | Parser end-index logic. JavaScript substring(start, end) excludes end. |
| No response | Device did not answer in time, or gateway read timing is too short | Timeout, keepOpen, Wireshark, raw gateway response. |
| Raw length is 1024 with null bytes | Gateway returns fixed buffer instead of received bytes | Native socket read/result conversion. |
Quotes break devices.js |
Unescaped quote in generated JavaScript | Use \x22 or keep response escaped. |
Recommended debug logging inside AnalyseFeedback
console.log("varPrefix:", varPrefix);
console.log("varPosition:", varPosition);
console.log("varDigits before:", varDigits);
console.log("varStopSign:", varStopSign);
console.log("mResultBrut:", mResultBrut);
varPositionPrefix = (mResultBrut.indexOf(varPrefix) + 1 + varPrefix.length);
console.log("indexOf prefix:", mResultBrut.indexOf(varPrefix));
console.log("varPositionPrefix:", varPositionPrefix);
console.log("text from prefix:", mResultBrut.substring(varPositionPrefix - 1, varPositionPrefix + 80));
if (varStopSign != "") {
var stopIndex = mResultBrut.indexOf(varStopSign, varPositionPrefix);
console.log("stopIndex:", stopIndex);
console.log("text at stop:", mResultBrut.substring(stopIndex - 10, stopIndex + 10));
}
Final model
transport + query + parsing = UI state
MyURemote integrations become reliable when commands, responses and feedback settings are treated as one deterministic chain.
