merge Code with Hanseis

This commit is contained in:
Marko Oldenburg 2017-04-26 06:38:01 +02:00
parent 8e59af7a24
commit 3e75834e02
3 changed files with 402 additions and 18 deletions

View File

@ -6,7 +6,8 @@
# All rights reserved
#
# Special thanks goes to comitters:
# - Olaf Schnicke
# - Olaf Schnicke Thanks for many many Code
# - Dieter Hehlgans Thanks for Commandref
#
#
# This script is free software; you can redistribute it and/or modify
@ -37,7 +38,7 @@ use JSON qw(decode_json);
use Encode qw(encode_utf8);
my $version = "0.1.72";
my $version = "0.1.76";
@ -618,7 +619,178 @@ sub HEOSGroup_GetGroupMute($) {
1;
=pod
=item device
=item summary Modul to controls the Denon multiroom soundsystem
=item summary_DE Modul zum steuern des Denon Multiroom-Soundsystem
=begin html
<a name="HEOSGroup"></a>
<h3>HEOSGroup</h3>
<ul>
<u><b>HEOSGroup</b></u>
<br><br>
In combination with HEOSMaster and HEOSPlayer this FHEM Module controls the Denon multiroom soundsystem using a telnet socket connection and the HEOS Command Line Interface (CLI).
<br><br>
Once the master device is created, the players and groups of Your system are automatically recognized and created in FHEM. From now on the players and groups can be controlled and changes in the HEOS app or at the Receiver are synchronized with the state and media readings of the players and groups.
<br>
<br>
Groups can be created from a player with "groupWithMember".
<br><br>
Example:
<ul><br>
<code>set living groupWithMember kitchen</code><br>
</ul>
<br>
... creates a group named "living+kitchen" with player "living" as leader and player "kitchen" as member.
<a name="HEOSGroupreadings"></a>
<br><br>
<a name="HEOSGroupreadings"></a>
<br><br>
<b>Readings</b>
<ul>
<li>channel - nr of now playing favorite</li>
<li>currentAlbum - name of now playing album</li>
<li>currentArtist - name of now playing artist</li>
<li>currentImageUrl - URL of cover art, station logo, etc.</li>
<li>currentMedia - type of now playing media (song|station|genre|artist|album|container)</li>
<li>currentMid - media ID</li>
<li>currentQid - queue ID</li>
<li>currentSid - source ID</li>
<li>currentStation - name of now playing station</li>
<li>currentTitle - name of now playing title</li>
<li>error - last error</li>
<li>gid - group ID</li>
<li>leader - leader of the group</li>
<li>member - member(s) of the group</li>
<li>mute - player mute state (on|off)</li>
<li>name - name of player (received from app)</li>
<li>playStatus - state of player (play|pause|stop)</li>
<li>repeat - player repeat state (on_all|on_one|off)</li>
<li>shuffle - player shuffle state (on|off)</li>
<li>state - state of player connection (on|off)</li>
<li>volume - player volume level (0-100)</li>
<li>volumeDown - player volume step level (1-10, default 5)</li>
<li>volumeUp - player volume step level (1-10, default 5)</li>
</ul>
<br><br>
<a name="HEOSGroupset"></a>
<b>set</b>
<ul>
<li>channel &ltnr&gt - plays favorite &ltnr&gt created with app</li>
<li>channelUp - switches to next favorite</li>
<li>channelDown- switches to previous favorite</li>
<li>clearGroup - dissolves the group (sets state to off)</li>
<li>GetGroupInfo - get media info of the group</li>
<li>mute on|off - set mute state on|off</li>
<li>next - play next title in queue</li>
<li>pause - set state of player to "pause"</li>
<li>play - set state of player to "play"</li>
<li>playPlaylist &ltmyList&gt - play playlist &ltmyList&gt</li>
<li>prev - play previous title in queue</li>
<li>repeat - set player repeat state (on_all|on_one|off)</li>
<li>shuffle - set player shuffle state on|off</li>
<li>stop - set state of player to "stop"</li>
<li>volume - set volume 0..100</li>
<li>volumeDown - reduce volume by &ltvolumeDown&gt</li>
<li>volumeUp - increase volume by &ltvolumeUp&gt</li>
</ul>
<br><br>
<a name="HEOSGroupstate"></a>
<b>state</b>
<ul>
<li>state of group (on|off)</li>
</ul>
</ul>
=end html
=begin html_DE
<a name="HEOSGroup"></a>
<h3>HEOSGroup</h3>
<ul>
<u><b>HEOSGroup</b></u>
<br><br>
In Kombination mit HEOSMaster and HEOSPlayer steuert dieses FHEM Modul das Denon Multiroom-Soundsystem mit Hilfe einer telnet Socket-Verbindung und dem HEOS Command Line Interface (CLI).
<br><br>
Nachdem der Master einmal angelegt ist werden die Player und Gruppierungen des Systems automatisch erkannt und in FHEM angelegt. Von da an k&oumlnnen die Player und Gruppierungen gesteuert werden und Ver&aumlnderungen in der HEOS App oder am Reveiver werden mit dem Status und den Media Readings der Player und Gruppierungen synchronisiert.
<br>
<br>
Gruppierungen k&oumlnnen aus einem Player heraus mit "groupWithMember" erzeugt werden.
<br><br>
Beispiel:
<ul><br>
<code>set Wohnzimmer groupWithMember K&uumlche</code><br>
</ul>
<br>
... erzeugt eine Gruppierung namens "Wohnzimmer+K&uumlche" mit dem Player "Wohnzimmer" als Leader und dem Player "K&uumlche" als Mitglied.
<a name="HEOSGroupreadings"></a>
<br><br>
<b>Readings</b>
<ul>
<li>channel - Nr des gerade abgespielten Favoriten</li>
<li>currentAlbum - Name des gerade abgespielten Albums</li>
<li>currentArtist - Name des gerade abgespielten K&uumlnstlers</li>
<li>currentImageUrl - URL des Albumcovers, Senderlogos, etc.</li>
<li>currentMedia - Medientyp des gerade abgespielten Streams (song|station|genre|artist|album|container)</li>
<li>currentMid - media ID</li>
<li>currentQid - queue ID</li>
<li>currentSid - source ID</li>
<li>currentStation - Name des gerade abgespielten Senders</li>
<li>currentTitle - Name des gerade abgespielten Titels</li>
<li>error - letzte Fehlermeldung</li>
<li>gid - Gruppen-ID</li>
<li>leader - Leader der Gruppierung</li>
<li>member - Mitglied(er) der Gruppierung</li>
<li>mute - Player mute Status (on|off)</li>
<li>name - Name der Gruppierung</li>
<li>playStatus - Status des Players (play|pause|stop)</li>
<li>repeat - Player Repeat Status (on_all|on_one|off) </li>
<li>shuffle - Player Shuffle Status (on|off)</li>
<li>state - Status der Player-Verbindung (on|off)</li>
<li>volume - aktuelle Lautst&aumlrke (0-100)</li>
<li>volumeDown - Schrittweite Lautst&aumlrke (1-10, default 5)</li>
<li>volumeUp - Schrittweite Lautst&aumlrke (1-10, default 5)</li>
</ul>
<br><br>
<a name="HEOSGroupset"></a>
<b>set</b>
<ul>
<li>channel &ltnr&gt - spielt den vorher mit der App erstellten Favoriten &ltnr&gt ab</li>
<li>channelUp - schaltet auf den n&aumlchsten Favoriten in der Favoritenliste um</li>
<li>channelDown- schaltet auf vorherigen Favoriten in der Favoritenliste um</li>
<li>clearGroup - Aufl&oumlsen der Gruppierung (setzt state auf off)</li>
<li>getGroupInfo - holt die Media-Informationen der Gruppierung</li>
<li>mute on|off - setze den mute Status on|off</li>
<li>next - spielt n&aumlchsten Titel in Warteschlange</li>
<li>pause - setzt den Status des Players auf "pause"</li>
<li>play - setzt den Status des Players auf "play"</li>
<li>playPlaylist &ltmyList&gt - spielt die Playlist &ltmyList&gt ab</li>
<li>prev - spielt vorherigen Titel in Warteschlange</li>
<li>repeat - setzt den Player Repeat Status (on_all|on_one|off) </li>
<li>saveQueue &ltmyList&gt - speichert die Warteschlange als Playlist &ltmyList&gt</li>
<li>shuffle - setzt den Player Shuffle Status auf on|off</li>
<li>stop - setzt den Status des Players auf "stop"</li>
<li>volume - setzt die Lautst&aumlrke auf 0..100</li>
<li>volumeDown - verringert die Lautst&aumlrke um &ltvolumeDown&gt</li>
<li>volumeUp - erh&oumlht die Lautst&aumlrke um &ltvolumeUp&gt</li>
</ul>
<br><br>
<a name="HEOSGroupstate"></a>
<b>state</b>
<ul>
<li>Status der Gruppierung (on|off)</li>
</ul>
</ul>
=end html_DE
=cut

View File

@ -6,7 +6,8 @@
# All rights reserved
#
# Special thanks goes to comitters:
# - Olaf Schnicke
# - Olaf Schnicke Thanks for many many Code
# - Dieter Hehlgans Thanks for Commandref
#
#
# This script is free software; you can redistribute it and/or modify
@ -54,7 +55,7 @@ eval "use IO::Socket::Multicast;1" or $missingModulNet .= "IO::Socket::Multicast
my $version = "0.1.72";
my $version = "0.1.76";
my %heosCmds = (
'enableChangeEvents' => 'system/register_for_change_events?enable=',
@ -1492,7 +1493,7 @@ sub HEOSMaster_MakeImage($$) {
<h3>HEOSMaster</h3>
<ul>
<u><b>HEOSMaster</b></u>
<br>
<br><br>
In combination with HEOSPlayer and HEOSGroup this FHEM Module controls the Denon multiroom soundsystem using a telnet socket connection and the HEOS Command Line Interface (CLI).
<br><br>
<b>Prerequisite</b>
@ -1511,7 +1512,7 @@ sub HEOSMaster_MakeImage($$) {
<code>define MyMasterBox HEOSMaster 192.168.178.67</code><br>
</ul>
<br>
&ltIP address&gt is the IP address of Your HEOS receiver or HEOS box. The master device is created in the room HEOS, then the players of Your system are automatically recognized and created in FHEM. From now on the players can be controlled and changes in the HEOS app or at the Receiver are synchronized with the state and media readings of the players.
&ltIP address&gt is the IP address of Your HEOS receiver or HEOS box. The master device is created in the room HEOS, then the players of Your system are recognized automatically and created in FHEM. From now on the players can be controlled and changes in the HEOS app or at the Receiver are synchronized with the state and media readings of the players.
<a name="HEOSMasterreadings"></a>
<br><br>
<b>Readings</b>
@ -1550,8 +1551,16 @@ sub HEOSMaster_MakeImage($$) {
<li>connected - the HEOSmaster is connected to the CLI Master</li>
<li>not connected - the HEOSmaster is not connected to the CLI Master</li>
</ul>
<br><br>
<a name="HEOSMasterattributes"></a>
<b>attributes</b>
<ul>
<li>heosUsername - username of Your HEOS account</li>
</ul>
<br><br>
</ul>
=end html
=end html
=begin html_DE
@ -1559,7 +1568,7 @@ sub HEOSMaster_MakeImage($$) {
<h3>HEOSMaster</h3>
<ul>
<u><b>HEOSMaster</b></u>
<br>
<br><br>
In Kombination mit HEOSPlayer und HEOSGroup steuert dieses FHEM Modul das Denon Multiroom-Soundsystem mit Hilfe einer telnet Socket-Verbindung und dem HEOS Command Line Interface (CLI).
<br><br>
<b>Voraussetzung</b>
@ -1619,6 +1628,14 @@ Von nun an k&oumlnnen die Player gesteuert werden. Au&szligerdem wird der Status
<li>connected - der HEOSmaster ist mit dem CLI Master verbunden</li>
<li>not connected - der HEOSmaster ist nicht mit dem CLI Master verbunden</li>
</ul>
<br><br>
<a name="HEOSMasterattributes"></a>
<b>Attributes</b>
<ul>
<li>heosUsername - Benutzername des HEOS Kontos</li>
</ul>
<br><br>
</ul>
=end html_DE

View File

@ -6,7 +6,8 @@
# All rights reserved
#
# Special thanks goes to comitters:
# - Olaf Schnicke
# - Olaf Schnicke Thanks for many many Code
# - Dieter Hehlgans Thanks for Commandref
#
#
# This script is free software; you can redistribute it and/or modify
@ -38,7 +39,7 @@ use Encode qw(encode_utf8);
use URI::Escape;
use Data::Dumper;
my $version = "0.1.72";
my $version = "0.1.76";
@ -1083,9 +1084,203 @@ sub HEOSPlayer_makeImage($$) {
1;
=pod
=item device
=item summary Modul to controls the Denon multiroom soundsystem
=item summary_DE Modul zum steuern des Denon Multiroom-Soundsystem
=begin html
<a name="HEOSPlayer"></a>
<h3>HEOSPlayer</h3>
<ul>
<u><b>HEOSPlayer</b></u>
<br><br>
In combination with HEOSMaster and HEOSGroup this FHEM Module controls the Denon multiroom soundsystem using a telnet socket connection and the HEOS Command Line Interface (CLI).
<br><br>
Once the master device is created, the players and groups of Your system are automatically recognized and created in FHEM. From now on the players and groups can be controlled and changes in the HEOS app or at the Receiver are synchronized with the state and media readings of the players and groups.
<a name="HEOSPlayerreadings"></a>
<br><br>
<b>Readings</b>
<ul>
<li>channel - nr of now playing favorite</li>
<li>currentAlbum - name of now playing album</li>
<li>currentArtist - name of now playing artist</li>
<li>currentImageUrl - URL of cover art, station logo, etc.</li>
<li>currentMedia - type of now playing media (song|station|genre|artist|album|container)</li>
<li>currentMid - media ID</li>
<li>currentQid - queue ID</li>
<li>currentSid - source ID</li>
<li>currentStation - name of now playing station</li>
<li>currentTitle - name of now playing title</li>
<li>ip-address - ip address of the player</li>
<li>lineout - lineout level type (variable|Fixed)</li>
<li>model - model of HEOS speaker (e.g. HEOS 1)</li>
<li>mute - player mute state (on|off)</li>
<li>name - name of player (received from app)</li>
<li>network - network connection type (wired|wifi)</li>
<li>playStatus - state of player (play|pause|stop)</li>
<li>repeat - player repeat state (on_all|on_one|off)</li>
<li>shuffle - player shuffle state (on|off)</li>
<li>state - state of player connection (on|off)</li>
<li>version - software version of HEOS speaker</li>
<li>volume - player volume level (0-100)</li>
<li>volumeDown - player volume step level (1-10, default 5)</li>
<li>volumeUp - player volume step level (1-10, default 5)</li>
</ul>
<br><br>
<a name="HEOSPlayerset"></a>
<b>set</b>
<ul>
<li>aux - uses source at aux-input of player</li>
<li>channel &ltnr&gt - plays favorite &ltnr&gt created with app</li>
<li>channelUp - switches to next favorite</li>
<li>channelDown- switches to previous favorite</li>
<li>clear queue - clears the queue</li>
<li>deletePlaylist &ltmyList&gt - clears playlist &ltmyList&gt</li>
<li>getNowPlayingMedia - get media info from now playing stream</li>
<li>getPlayMode - get player mode (repeat|shuffle)</li>
<li>getPlayState - get player state (play|pause|stop)</li>
<li>getPlayerInfo - get player info (pid, gid, network, ...)</li>
<li>set &lthp1&gt groupWithMember &lthp2&gt - creates group with hp1 as leader and hp2 as member</li>
<li>input sid[,cid][,mid] - set input source-id[,container-id][,media-id] </li>
<li>mute on|off - set mute state on|off</li>
<li>next - play next title in queue</li>
<li>pause - set state of player to "pause"</li>
<li>play - set state of player to "play"</li>
<li>playPlaylist &ltmyList&gt - play playlist &ltmyList&gt</li>
<li>playQueueItem &ltnr&gt - play title &ltnr&gt in queue</li>
<li>prev - play previous title in queue</li>
<li>repeat - set player repeat state (on_all|on_one|off)</li>
<li>saveQueue &ltmyList&gt - save queue as &ltmyList&gt</li>
<li>shuffle - set player shuffle state on|off</li>
<li>stop - set state of player to "stop"</li>
<li>volume - set volume 0..100</li>
<li>volumeDown - reduce volume by &ltvolumeDown&gt</li>
<li>volumeUp - increase volume by &ltvolumeUp&gt</li>
</ul>
<br><br>
<a name="HEOSPlayerget"></a>
<b>get</b>
<ul>
<li>ls - list music sources (input, playlists, favorites, music services, ...) </li>
<li>channelscount - number of favorites</li>
</ul>
<br><br>
<a name="HEOSPlayerstate"></a>
<b>state</b>
<ul>
<li>state of player connection (on|off)</li>
</ul>
<br><br>
<a name="HEOSPlayerattributes"></a>
<b>attributes</b>
<ul>
<li>channelring - when reaching the last favorite ChannelUp/Down switches in circle, i.e. to the first/last favorite again</li>
<li>mute2play - if mute switch at speaker is pressed, the stream stops</li>
</ul>
</ul>
=end html
=begin html_DE
<a name="HEOSPlayer"></a>
<h3>HEOSPlayer</h3>
<ul>
<u><b>HEOSPlayer</b></u>
<br><br>
In Kombination mit HEOSMaster and HEOSGroup steuert dieses FHEM Modul das Denon Multiroom-Soundsystem mit Hilfe einer telnet Socket-Verbindung und dem HEOS Command Line Interface (CLI).
<br><br>
Nachdem der Master einmal angelegt ist werden die Player und Gruppierungen des Systems automatisch erkannt und in FHEM angelegt. Von da an k&oumlnnen die Player und Gruppierungen gesteuert werden und Ver&aumlnderungen in der HEOS App oder am Reveiver werden mit dem Status und den Media Readings der Player und Gruppierungen synchronisiert.
<a name="HEOSPlayerreadings"></a>
<br><br>
<b>Readings</b>
<ul>
<li>channel - Nr des gerade abgespielten Favoriten</li>
<li>currentAlbum - Name des gerade abgespielten Albums</li>
<li>currentArtist - Name des gerade abgespielten K&uumlnstlers</li>
<li>currentImageUrl - URL des Albumcovers, Senderlogos, etc.</li>
<li>currentMedia - Medientyp des gerade abgespielten Streams (song|station|genre|artist|album|container)</li>
<li>currentMid - media ID</li>
<li>currentQid - queue ID</li>
<li>currentSid - source ID</li>
<li>currentStation - Name des gerade abgespielten Senders</li>
<li>currentTitle - Name des gerade abgespielten Titels</li>
<li>ip-address - IP-Adresse des Players</li>
<li>lineout - lineout level type (variable|Fixed)</li>
<li>model - Modell des HEOS Lautsprechers (z.B. HEOS 1)</li>
<li>mute - Player mute Status (on|off)</li>
<li>name - Name des Players (aus der App &uumlbernommen)</li>
<li>network - Netzwerkverbindung (wired|wifi)</li>
<li>playStatus - Status des Players (play|pause|stop)</li>
<li>repeat - Player Repeat Status (on_all|on_one|off) </li>
<li>shuffle - Player Shuffle Status (on|off)</li>
<li>state - Status der Player-Verbindung (on|off)</li>
<li>version - Softwareversion des HEOS Lautsprechers</li>
<li>volume - aktuelle Lautst&aumlrke (0-100)</li>
<li>volumeDown - Schrittweite Lautst&aumlrke (1-10, default 5)</li>
<li>volumeUp - Schrittweite Lautst&aumlrke (1-10, default 5)</li>
</ul>
<br><br>
<a name="HEOSPlayerset"></a>
<b>set</b>
<ul>
<li>aux - aktiviert die Quelle am AUX-Eingang des Players</li>
<li>channel &ltnr&gt - spielt den vorher mit der App erstellten Favoriten &ltnr&gt ab</li>
<li>channelUp - schaltet auf den n&aumlchsten Favoriten in der Favoritenliste um</li>
<li>channelDown- schaltet auf vorherigen Favoriten in der Favoritenliste um</li>
<li>clear queue - l&oumlscht die Warteschlange</li>
<li>deletePlaylist &ltmyList&gt - l&oumlscht die Playlist &ltmyList&gt </li>
<li>getNowPlayingMedia - holt die Mediainfo vom aktuell abgespielten Mediastream</li>
<li>getPlayMode - holt den Player-Modus (repeat|shuffle)</li>
<li>getPlayState - holt den Player-Status (play|pause|stop)</li>
<li>getPlayerInfo - holt Player-Info (pid, gid, network, ...)</li>
<li>set &lthp1&gt groupWithMember &lthp2&gt - erzeugt eine Gruppierung mit hp1 als Leader und hp2 als Mitglied</li>
<li>input sid[,cid][,mid] - setze input source-id[,container-id][,media-id] </li>
<li>mute on|off - setzt den mute Status on|off</li>
<li>next - spielt n&aumlchsten Titel in Warteschlange</li>
<li>pause - setzt den Status des Players auf "pause"</li>
<li>play - setzt den Status des Players auf "play"</li>
<li>playPlaylist &ltmyList&gt - spielt die Playlist &ltmyList&gt ab</li>
<li>playQueueItem &ltnr&gt - spielt Titel &ltnr&gt in Warteschlange</li>
<li>prev - spielt vorherigen Titel in Warteschlange</li>
<li>repeat - setzt den Player Repeat Status (on_all|on_one|off) </li>
<li>saveQueue &ltmyList&gt - speichert die Warteschlange als Playlist &ltmyList&gt</li>
<li>shuffle - setzt den Player Shuffle Status auf on|off</li>
<li>stop - setzt den Status des Players auf "stop"</li>
<li>volume - setzt die Lautst&aumlrke auf 0..100</li>
<li>volumeDown - verringert die Lautst&aumlrke um &ltvolumeDown&gt</li>
<li>volumeUp - erh&oumlht die Lautst&aumlrke um &ltvolumeUp&gt</li>
</ul>
<br><br>
<a name="HEOSPlayerget"></a>
<b>get</b>
<ul>
<li>ls - listet Musikquellen (Eing&aumlnge, Playlists, Favorites, Musik-Dienste, ...)</li>
<li>channelscount - Anzahl der Favoriten</li>
</ul>
<br><br>
<a name="HEOSPlayerstate"></a>
<b>state</b>
<ul>
<li>Status der Player-Verbindung (on|off)</li>
</ul>
<br><br>
<a name="HEOSPlayerattributes"></a>
<b>attributes</b>
<ul>
<li>channelring - Beim Erreichen des letzten Favoriten schaltet ChannelUp/Down im Kreis, also wieder auf den ersten/letzten Favoriten</li>
<li>mute2play - Beim Bet&aumltigen der Mute-Taste am Lautsprecher wird auch der Stream angehalten</li>
</ul>
</ul>
=end html_DE
=cut