Control and monitor SONOS devices with ioBroker.
- States for handling SONOS groups:
coordinator
: set/get the coordinator, so the SONOS device which is the master and coordinating the group. It requires the IP address (channel name) of the SONOS device to be the coordinator, but with underscore_
instead of dot.
, so use for example192_168_0_100
for IP address192.168.0.100
. If the device does not belong to any group, then the value is equal to the own channel name (IP).group_volume
: the volume of the groupgroup_muted
: mute status of the group.add_to_group
: Add a certain SONOS device to the SONOS device under which this state is. Use IP address with underscores (see above).remove_from_group
: Remove a certain SONOS device from the SONOS device under which this state is. Use IP address with underscores (see above).
*) These states will be updated if changes are made in the SONOS app.
To use the sayit adapter with this SONOS adapter, ensure that the web adapter is instantiated and running too. The web adapter is required to allow the SONOS adapter to read the generated MP3 file from the sayit adapter.
Please note: This SONOS adapter has stability issues if using 'text to speech' with the sayIt adapter. Symptoms observed:
- Arbitrary change of volume to 0 or 100 %.
- No response after a random number of text to speech sequences
Workaround for text to speech is to use the SONOS HTTP API.
Use states favorites_list_html
and queue_html
to show playlists and current queue with basic html widget in VIS. By click on a row the playlist or track will be played immediatly.
Format the table with following css classes:
sonosFavoriteTable
: hole favorite tablesonosFavoriteRow
: rows with favorite informationsonosFavoriteNumber
: Number of favoritesonosFavoriteCover
: Album art of favorite (grab image with.sonosFavoriteCover img
)sonosFavoriteTitle
: Name of favorite
.sonosQueueTable
: hole table.sonosQueueRow
: rows containing track information.currentTrack
: added to the row containg current playing track.sonosQueueTrackNumber
: Number or track.sonosQueueTrackCover
: Album art of track (grab image with.sonosQueueTrackCover img
).sonosQueueTrackArtist
: Name of artist.sonosQueueTrackAlbum
: Name of album (usedisplay:none
if not needed).sonosQueueTrackTitle
: Name of title
For long lists add overflow:auto;
or overflow-y:auto;
to basic html widget.
Please note: highlighting current playing favorite is not supported.
.sonosFavoriteTable {
color: #bbb;
font-size: 12px;
}
.sonosFavoriteRow {
cursor: pointer;
}
.sonosFavoriteNumber {}
.sonosFavoriteCover img {
width: 30px;
height: 30px;
}
.sonosFavoriteTitle {}
.sonosQueueTable {
color: #bbb;
font-size: 12px;
}
.sonosQueueRow {
display: table-row;
cursor: pointer;
}
.sonosQueueRow.currentTrack {
color: #fff;
font-weight: bold;
}
.sonosQueueTrackNumber {}
.sonosQueueTrackCover img {
width: 30px;
height: 30px;
display: table-column;
}
.sonosQueueTrackArtist {
display: table-row;
}
.sonosQueueTrackAlbum {
display: none;
}
.sonosQueueTrackTitle {
display: table-row;
}
- Rewrite with https://github.com/svrooij/node-sonos-ts
- Web server - [optional] If web server enabled or not
- Update of elapsed time(ms) - Interval in ms how often to update elapsed timer when the title is playing. (Default 2000)
- (foxriver76) fixed cover url
- (foxriver76) store the cover file in files instead of binary states
- (Apollon77) Prepare for future js-controller versions
- (Standarduser & Jey-Cee) Added new states
favorites_list_html
andqueue_html with covers
- (Standarduser) Changed default album art if no cover was found
- (bluefox) Configuration migrated to JSON-Config
- (Rello) Added track number state
- (Apollon77) Prevent js-controller warnings
- (Apollon77) fix group volume state
- (Apollon77) Remove logic that adjusted the group volume after one member volume was set
- (Apollon77) Make sure to not set state values for devices that are not configured
- (Apollon77) Try to catch network errors
- (bluefox) Corrected error with "SONOS not found"
- (bluefox) Catch possible errors by the start and unload
- (Apollon77) Prevent crash case (Sentry IOBROKER-JS-CONTROLLER-S7, #78)
- (bluefox) TTS Refactoring
- (bluefox) Refactoring
- (klein0r) create sonos cache directory
- (bluefox) no web server any more
- (bluefox) update all used npm packages
- (bluefox) Support js-controller compact mode
- (bluefox) Fixed error with node.js 6
- (bluefox) Trying to correct fade-out
- (bluefox) The group volume has a valid role now
- (bluefox) Important changes: state cover.png renamed to "cover_png"
- (bluefox) added shuffle, repeat and crossfade modes. To enable it you must delete device from list and add it again
- (bluefox) better icon
- (bluefox) fix fade out option
- (bluefox) Ready for npm6
- (bluefox) Added the support of Admin3
- (soef) no duration/elapsed update on radio
- (justr1) Enhance group Handling
- (bluefox) use new configuration dialog
- (soef) removeFromGroup extended
- (bluefox) Allow to use the sonos web via with proxy
- (bluefox) add states for vis control and change some roles
- (bluefox) Fix TTS if fade was 0
- (bluefox) Fix api changes of SONOS module
- (bluefox) add web adapter as dependency
- (bluefox) tts was rewritten because of new sonos-discovery interface
- (bluefox) update sonos npm packets
- (bluefox) configurable fadeIn and fadeOut
- (bluefox) fix fade out
- (bluefox) fix types of states
- (soef) fixed restore of radio after sayIt
- (soef) fixed restore of radio after sayIt
- (bluefox) fix log outputs
- (bluefox) update libraries and use fix versions of it
- (bluefox) check type of "state"
- (bluefox) change default port to 8080
- (hagen) - Better handling of radio stations (show -> album, streamInfo -> artist)
- (hagen) New state 'current_type' to tell if a track or radio is playing
- (hagen) (Hopefully) fixed the unreliable cover art update
- (bluefox) fix favorites set
- (bluefox) implement tts if radio is playing
- (bluefox) set volume by TTS
- (bluefox) catch errors if states deleted
- (bluefox) enable npm install
- (bluefox) redirect logging messages to ioBroker
- (bluefox) translate grid in config dialog
- (bluefox) use sonos-web-controller module as tarball from git
- (bluefox) support of new naming concept
- (bluefox) support of text to speech
- (bluefox) support of text to speech and cover image
- (bluefox) improve configuration edit
The MIT License (MIT)
Copyright (c) 2014-2023, bluefox [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.