Table of Contents minLevel 2
Public version not yet ready, but I'm looking for BETA TESTERS!If you are interested, send an email to ales DOT berka DOT dev AT gmail
Requires LoxBerry 1.2.2+
- Follow the standard installation procedure to install the plugin, just link/upload the ZIP file in/to the LoxBerry Plugin Management.
- After the installation, head to the plugin pages in the LoxBerry Web UI and enter the Configuration.
- Return to Overview once finished to validate the configuration:
- LoxBerry status should say "server running". If not, check your configuration of UDP Port and restart LoxBerry, if still not OK. Check Log, still not OK
- Chromecast status should say "Connected". If not, check your configuration of Chromecast IP. Make sure the Chromecast is on the same network (same sub net). See Troubleshooting, tips below
- "Replies will be sent to:" section shows the configured Loxone target. Optional.
Plugin contains a server, which listens for UDP commands coming from Loxone Miniserver, performs desired actions on Chromecast and replies results back to Loxone via another UDP transmission.
- Query status
- Query volume
- Get notified of volume changes
- Control volume (both absolute and relative)
- Play (cast) a stream
- Pause/Stop current cast
- Quit current application
Plugin needs to be configured first. You need to set:
- UDP port (where the plugin accepts UDP commands)
- Chromecast address (if you don't know it, try Discover tab in the plugin, it scans LAN for Chromecasts and lists their IPs)
- Loxone Miniserver IP address and UDP port (where to send the replies). This is optional. If you don't want to receive result (or to query the volume), you don't need to configure it.
- Periodic volume change detection. This is optional. If defined (as a number of seconds), enabled active polling for volume change compared to last known value. The configured time is the amount of seconds how often or how soon after last command is the volume polled. This polling happens on LoxBerry. If a volume change is detected, then (and only then) the message is sent to Loxone Miniserver (ie. Loxone isn't receiving periodic messages unless there's a change). If you need periodic reporting to Loxone, query the volume (using GET_VOLUME command described below) on your own.
To control Chromecast:
- Create Virtual Output, as address use udp://<loxberry_ip>:<configured_udp_port>
- Under this Virtual Output, create desired Virtual output commands. This is a list of supported functions (to be entered into "Command for ON"):
- SET_VOLUME <v> (Uncheck Use as digital output and copy paste the command including the angle brackets and "v" (less-than and greater_than signs)!
- ADJUST_VOLUME 5 (feel free to change 5 to a different number, if you want bigger or smaller volume increase in one step)
- ADJUST_VOLUME -5 (feel free to change -5 to a different number, if you want bigger or smaller volume decrease in one step)
- PLAY stream_url
You can use the UDP monitor (feature of Loxone Config) to explore the replies
You can send multiple commands at once, separated by semicolon ( ; ). Replies always start with asterisk ( * ) and end with semicolon ( ; ). There is no escaping at the moment
Commands (received and recognized by Chromecast 4 Lox)
Checks the Chromecast status. Returns free text returned from builtin Chromecast controlling utility prefixed by "STATUS:\n" and ended by ";"
Connecting to 192.168.1.51:8009...
[Default Media Receiver] Default Media Receiver
Queries Chromecast volume, which is returned as integer value 0-100, prefixed by "*GET_VOLUME_ACK " (including the space) and ended by ";"
Sets the new volume level. Command format "
SET_VOLUME number" where number is the volume level, integer, 0-100.
*SET_VOLUME_NACK;(if failed, for instance Chromecast was not reachable, in case of network issues, etc. For details check Log)
Adjusts the new volume level by defined difference (positive or negative for volume increase or decrease). Command format "
ADJUST_VOLUME delta" where delta is the volume difference, integer, -100..100, to be added to the current volume level. The purpose of this function is accommodate volume up and volume down operations.
Sample response (from a Chromecast having a volume level 65 before the command was processed):
Plays (casts) remote stream (defined by URL) on Chromecast. Supported formats rely completely on Chromecast, LoxBerry plugin passes just the URL. Command format "
PLAY url" where url is the address of the stream. From the Chromecast Help, Chromecast Audio supports: HE-AAC, LC-AAC, MP3, Vorbis, WAV (LPCM), Opus, FLAC with support for high-resolution streams (24-bit/96KHz).
Pauses Chromecast playback.
*PAUSE_NACK;(if failed, for instance Chromecast was not reachable, in case of network issues, etc. For details check Log)
Stops Chromecast playback.
*STOP_NACK;(if failed, for instance Chromecast was not reachable, in case of network issues, etc. For details check Log)
Closes current app on Chromecast
*QUIT_NACK;(if failed, for instance Chromecast was not reachable, in case of network issues, etc. For details check Log)
Messages sent to Loxone Miniserver (besides replies to commands described above)
Periodic volume notification
Periodic check of volume (if configured) sends "
;" messages to Loxone upon volume change, where number is the new volume level, integer, 0-100.
Sample message sent to Loxone Miniserver:
Chromecast connection status is reported (if changes) after each communication with the device. Offline message is repeated after each failed attempt. Periodic repeating of the message can be configured on top of this. It is important to understand the status reporting period is dependent on any action on Chromecast. Without it will not report anything, ie. it is recommended to have Periodic volume notification enabled (and the Period of volume notifications should be less or equal to Connection status reporting period).
Sample message sent to Loxone Miniserver:
To be considered:
Active monitoring for volume changesDONE (polling-based) Volume up/downDONE.
- Support M3U/PLS files as a casting source (medium priority)
- Google Music All Access integration (no promises, no timelines, just a wish)
- Active monitoring for volume changes (event-based) (very low priority)
- Support multiple Chromecast devices (high priority)
- If you don't want to use "slightly less secure" WiFi on the same network as LoxBerry (Chromecast doesn't support WPA Enterprise/802.1x, only WPA2-PSK), consider Chromecast Ethernet Adapter. Even cheap 3rd party product from ebay/Aliexpress has proven to work great. You'll also get a nice bonus on top of the security - absolute connection stability
- In case of any issue, check the Log
- If the UDP server crashes, you'll need to restart the LoxBerry to get it up again
Known issues, limitations
- Some ShoutCast/IceCast streams are not supported by Chromecast (nothing I can do about it, unless a conversion proxy is made, which is not in scope of this small plugin)
Questions, bug reports