--- a/98_BOSEST.pm 2023-05-20 08:02:26.000000000 +0200
+++ b/98_BOSEST.pm 2026-01-28 23:30:18.795102399 +0100
@@ -7,10 +7,13 @@
# FHEM module to communicate with BOSE SoundTouch system
# API as defined in BOSE SoundTouchAPI_WebServices_v1.0.1.pdf
#
-# Version: 2.2.1
+# Version: 2.2.2
#
#############################################################
#
+# v2.2.2 - 20260125
+# - CHANGE: Add PRODUCT TV and HDMI_1 to source for ST300
+#
# v2.2.1 - 20181127
# - CHANGE: add staticIPs documentation in commandref
#
@@ -341,7 +344,7 @@
$hash->{helper}{supportedBassCmds} = "";
if (int(@a) < 3) {
- Log3 $hash, 3, "BOSEST: BOSE SoundTouch v2.2.1";
+ Log3 $hash, 3, "BOSEST: BOSE SoundTouch v2.2.2";
#start discovery process 30s delayed
InternalTimer(gettimeofday()+30, "BOSEST_startDiscoveryProcess", $hash, 0);
@@ -374,9 +377,10 @@
return undef;
}
-sub BOSEST_Set($@) {
- my ($hash, $name, @params) = @_;
- my $workType = shift(@params);
+sub BOSEST_Set
+{
+ my ($hash, $name, $workType, @params) = @_;
+ Log3 $hash, 3, "BOSEST: BOSEST_Set: $name, $workType\n".Dumper(\@params) if ($workType ne "?");
#get quoted text from params
my $blankParams = join(" ", @params);
@@ -884,7 +888,23 @@
$hash->{helper}{switchSource} = uc $source;
- if($hash->{helper}{switchSource} eq "") {
+ #FIXME: switchSource has volume num value via fhem webif
+ if($hash->{helper}{switchSource} eq "" || looks_like_number($hash->{helper}{switchSource})) {
+ return undef;
+ }
+
+ if($hash->{helper}{switchSource} eq "TV" || $hash->{helper}{switchSource} eq "HDMI1") {
+ my $sourceAccount = $hash->{helper}{switchSource} eq "TV" ? "TV" : "HDMI_1";
+ my $postXml = "<ContentItem source=\"".
+ "PRODUCT".
+ "\" sourceAccount=\"".
+ $sourceAccount.
+ "\" isPresetable=\"true\">".
+ "</ContentItem>";
+
+ if(BOSEST_HTTPPOST($hash, "/select", $postXml)) {
+ #ok
+ }
return undef;
}
@@ -2137,6 +2157,8 @@
$deviceHash->{helper}{bluetoothSupport} = 0;
$deviceHash->{helper}{auxSupport} = 0;
$deviceHash->{helper}{airplaySupport} = 0;
+ $deviceHash->{helper}{productTvSupport} = 0;
+ $deviceHash->{helper}{productHdmi1Support} = 0;
$deviceHash->{helper}{supportedSourcesCmds} = "";
foreach my $source (@params) {
if($source eq "BLUETOOTH") {
@@ -2148,7 +2170,14 @@
} elsif($source eq "AIRPLAY") {
$deviceHash->{helper}{airplaySupport} = 1;
$deviceHash->{helper}{supportedSourcesCmds} .= "airplay,";
- }
+ } elsif($source eq "PRODUCT") {
+ #quick hack, we also need sourceAccount value for PRODUCT
+ if($deviceHash->{helper}{productTvSupport} == 0 && $deviceHash->{helper}{productHdmi1Support} == 0) {
+ $deviceHash->{helper}{productTvSupport} = 1;
+ $deviceHash->{helper}{productHdmi1Support} = 1;
+ $deviceHash->{helper}{supportedSourcesCmds} .= "tv,hdmi1,";
+ }
+ }
}
$deviceHash->{helper}{supportedSourcesCmds} = substr($deviceHash->{helper}{supportedSourcesCmds}, 0, length($deviceHash->{helper}{supportedSourcesCmds})-1);
} elsif($command eq "capabilities") {
@@ -2577,7 +2606,7 @@
<li><code><b>repeat</b> all|one|off</code> - control repeat mode</li>
<li><code><b>bass</b> 0...10</code> - set the bass level</li>
<li><code><b>recent</b> 0...15</code> - set number of names in the recent list in readings</li>
- <li><code><b>source</b> bluetooth,bt-discover,aux mode, airplay</code> - select a local source</li><br>
+ <li><code><b>source</b> bluetooth,bt-discover,aux mode,airplay,tv,hdmi1</code> - select a local source</li><br>
<li><code><b>addDLNAServer</b> Name1 [Name2] [Namex]</code> - add DLNA servers Name1 (and Name2 to Namex) to the BOSE library</li>
<li><code><b>removeDLNAServer</b> Name1 [Name2] [Namex]</code> - remove DLNA servers Name1 (and Name2 to Namex) to the BOSE library</li>
</ul><br>Internals:
CFGFN
FUUID 6979e694-f33f-8d5d-749a-39a8910556018c2e
NAME dummy.bierkeller
NR 240574
STATE ???
TYPE dummy
eventCount 357
OLDREADINGS:
READINGS:
2026-01-28 12:52:21 01.bier Reissdorf Kölsch
2026-01-28 12:52:21 01.brauerei Privat-Brauerei Heinrich Reissdorf
2026-01-28 12:52:21 01.menge 9
2026-01-28 12:52:21 01.stil Kölsch
2026-01-28 12:52:21 02.bier Spaten München / Münchner Hell / Premium Lager
2026-01-28 12:52:21 02.brauerei Spaten-Franziskaner-Löwenbräu-Gruppe
2026-01-28 12:52:21 02.menge 8
2026-01-28 12:52:21 02.stil Lager - Helles
2026-01-28 12:52:21 03.bier Plob
2026-01-28 12:52:21 03.brauerei Woinemer Hausbrauerei
2026-01-28 12:52:21 03.menge 18
2026-01-28 12:52:21 03.stil Lager - Helles
2026-01-28 12:52:21 04.bier Paulaner Oktoberfest Bier
2026-01-28 12:52:21 04.brauerei Paulaner Brauerei
2026-01-28 12:52:21 04.menge 5
2026-01-28 12:52:21 04.stil Festbier
2026-01-28 12:52:21 05.bier Lagerbier Hell
2026-01-28 12:52:21 05.brauerei Augustiner-Bräu München
2026-01-28 12:52:21 05.menge 20
2026-01-28 12:52:21 05.stil Lager - Helles
2026-01-28 12:52:21 06.bier Einbecker Winter-Bock
2026-01-28 12:52:21 06.brauerei Einbecker Brauhaus
2026-01-28 12:52:21 06.menge 20
2026-01-28 12:52:21 06.stil Bock - Doppelbock
2026-01-28 12:52:21 07.bier Erdinger Brauhaus Helles
2026-01-28 12:52:21 07.brauerei Erdinger Weissbräu
2026-01-28 12:52:21 07.menge 20
2026-01-28 12:52:21 07.stil Lager - Helles
2026-01-28 12:52:21 08.bier Bitburger Radler
2026-01-28 12:52:21 08.brauerei Bitburger Brauerei
2026-01-28 12:52:21 08.menge 8
2026-01-28 12:52:21 08.stil Shandy / Radler
2026-01-28 12:52:21 09.bier Erdinger Alkoholfrei
2026-01-28 12:52:21 09.brauerei Erdinger Weissbräu
2026-01-28 12:52:21 09.menge 13
2026-01-28 12:52:21 09.stil Non-Alcoholic - Wheat
2026-01-28 12:52:21 10.bier Nürnberger Christkindlesmarkt Bier
2026-01-28 12:52:21 10.brauerei Tucher Bräu
2026-01-28 12:52:21 10.menge 12
2026-01-28 12:52:21 10.stil Lager - Winter
2026-01-28 12:52:21 11.bier Bitburger Premium Pils
2026-01-28 12:52:21 11.brauerei Bitburger Brauerei
2026-01-28 12:52:21 11.menge 12
2026-01-28 12:52:21 11.stil Pilsner - German
Attributes:
event-on-change-reading .*
room 8.6_TodoIstInternals:
CFGFN
DEF <Reading>,<Stil>,<Bier>,<Brauerei>,<Menge> dummy.bierkeller:.*.stil,
FUUID 6979f531-f33f-8d5d-ddf9-8bb26e2d02f1b9f2
NAME rg.bierkeller
NR 242865
NTFY_ORDER 50-rg.bierkeller
STATE Initialized
TYPE readingsGroup
changed 0
eventCount 2
mayBeVisible 1
CONTENT:
dummy.bierkeller 1
CONTENT2:
DEVICES:
ARRAY(0xa398408)
ARRAY(0xa5d26d0)
fhem:
lastDefChange 334
last_update 1769635890.41399
helper:
DEF
positions:
dummy.bierkeller.01.stil 2:1
dummy.bierkeller.02.stil 2:2
dummy.bierkeller.03.stil 2:3
dummy.bierkeller.04.stil 2:4
dummy.bierkeller.05.stil 2:5
dummy.bierkeller.06.stil 2:6
dummy.bierkeller.07.stil 2:7
dummy.bierkeller.08.stil 2:8
dummy.bierkeller.09.stil 2:9
dummy.bierkeller.10.stil 2:10
dummy.bierkeller.11.stil 2:11
values:
formated:
undef
ARRAY(0xb5a7e10)
ARRAY(0x95250a0)
ARRAY(0x9b95460)
ARRAY(0xa262578)
ARRAY(0xa48c4a0)
ARRAY(0x91013c8)
ARRAY(0xa894890)
ARRAY(0x90bad20)
ARRAY(0x887feb0)
ARRAY(0x8905aa0)
ARRAY(0x8761fb8)
orig:
undef
ARRAY(0x8fbed00)
ARRAY(0xa1293d0)
ARRAY(0xad46d50)
ARRAY(0xac46348)
ARRAY(0x9e83270)
ARRAY(0x9400da8)
ARRAY(0x8e4e738)
ARRAY(0xa54e9a0)
ARRAY(0x8939b48)
ARRAY(0xa5d8450)
ARRAY(0x9b72c68)
prefixsuffix:
undef
ARRAY(0xada24b0)
ARRAY(0x909da00)
ARRAY(0x840b6e8)
ARRAY(0x83c8b78)
ARRAY(0xa043328)
ARRAY(0x9198780)
ARRAY(0x90e8888)
ARRAY(0x97608b8)
ARRAY(0x8e0ea30)
ARRAY(0x8f48020)
ARRAY(0x88ab558)
Attributes:
room 8.6_TodoIst
sortColumn 2Zitat von: sven.luebke am 28 Januar 2026, 16:47:58Ich hatte kurz gesucht, ob es eine Art Template gibt,
Zitat von: satprofi am 28 Januar 2026, 19:21:51ich möchte aber wenn der Schalter betätigt wird der Sensor nicht schaltet.