Zitat von: schwatter am 18 April 2026, 07:15:12Daher ignoriere mich einfach...Ungern
.define t2s Text2Speech none
attr t2s TTS_Ressource maryTTS
attr t2s TTS_User host='http://127.0.0.1:5000/' method=POST header='{ "Content-Type" => "application/json" }' body='{ "text": "$text" }'
attr t2s verbose 5
} elsif ( $TTS_Ressource eq 'maryTTS' ) {
my $mTTSurl = $TTS_User;
my($unnamed, $named) = parseParams($mTTSurl);
$named->{host} //= shift @{$unnamed} // '127.0.0.1';
$named->{port} //= shift @{$unnamed} // '59125';
$named->{lang} //= shift @{$unnamed} // !$TTS_Language || $TTS_Language eq 'Deutsch' ? 'de_DE' : $TTS_Language;
$named->{voice} //= shift @{$unnamed} // 'de_DE/thorsten_low';
$named->{endpoint} //= shift @{$unnamed} // 'process';
#$named->{method} //= shift @{$unnamed} // 'GET';
if (defined $named->{method} && $named->{method} eq 'POST') {
$mTTSurl = $named->{host};
} else {
$mTTSurl = "http://$named->{host}:$named->{port}/$named->{endpoint}?INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&AUDIO=WAVE_FILE&LOCALE=$named->{lang}&VOICE=$named->{voice}&INPUT_TEXT="; # https://github.com/marytts/marytts-txt2wav/blob/python/txt2wav.py#L21
$mTTSurl .= uri_escape($text);
}
Log3( $hash->{NAME}, 4, "$hash->{NAME}: Hole URL: $mTTSurl" );
my $param = { url => $mTTSurl,
timeout => 5,
hash => $hash, # Muss gesetzt werden, damit die Callback funktion wieder $hash hat
method => $named->{method} // 'GET' # POST can be found in https://github.com/marytts/marytts-txt2wav/blob/python/txt2wav.py#L33
};
$param->{header} = $named->{header} if defined $named->{header};
if (defined $named->{body}) {
$named->{body} =~ s{(\$\w+)}{$1}eegx;
$param->{body} = $named->{body};
Log3($hash->{NAME}, 3, "$hash->{NAME} body: $param->{body}, header: $param->{header}");
}
my ($maryTTSResponseErr, $maryTTSResponse) = HttpUtils_BlockingGet($param);
if(length($maryTTSResponseErr) > 0) {
Log3($hash->{NAME}, 3, "$hash->{NAME}: Fehler beim Abrufen der Daten von $TTS_Ressource: $maryTTSResponseErr");
return;
}
my $FileWav2 = $file . '.wav';
my $fh2 = new IO::File ">$FileWav2";
if ( !defined $FileWav2 ) {
Log3($hash->{NAME}, 2, "$hash->{NAME}: wav Datei <$FileWav2> konnte nicht angelegt werden.");
return;
}
$fh2->print($maryTTSResponse);
Log3($hash->{NAME}, 4, "$hash->{NAME}: Schreibe wav in die Datei $FileWav2, Bytes: ".length $maryTTSResponse);
close $fh2;
$cmd = qq(lame "$FileWav2" "$file");
Log3($hash, 4, "$hash->{NAME}:$cmd");
system $cmd;
return unlink $FileWav2;
}Irgendeine Kleinigkeit paßt noch nicht, vermutlich im Header (ich habe einige Versionen durch, muss jetzt aber auch mal was anderes machen)? Jedenfalls will HttpUtils_BlockingGet() eigentlich einen Endpunkt haben, und via curl bekomme ich auch mit dem ersten slash eine wav:curl -X POST -H 'Content-Type: application/json' -d '{ "text": "thorsten sagt jetzt mal wieder etwas an" }' -o test.wav localhost:5000/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 84577 100 84524 100 53 228k 146 --:--:-- --:--:-- --:--:-- 228k
odercurl -X POST -H 'Content-Type: application/json' -d '{ "text": "thorsten sagt wieder etwas an" }' -o test.wav http://localhost:5000/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 69719 100 69676 100 43 317k 200 --:--:-- --:--:-- --:--:-- 318k
Zitat von: MadMax am 07 Dezember 2025, 14:19:20Bei mir läuft es mit einem SPT8.0SE und einem SBS2.5.
attr <name> InstallerLogin 1
attr <name> detail-level 2
SBS2.5 mit LG10H-RESU = kein Erfolg / keine Werte
bat_lower_discharge_limit
bat_deep_discharge_protection_area
bat_inv_BAT_conserving_battery_state_of_charge_area
leider gar keine Werte !

Zitat von: Wzut am 18 April 2026, 09:08:41Könntest bitte alle deine Readingsnamen nach Bedeutung aufschlüsseln ?
Bei quota_powGetBpCms handelt es sich vermutlich um den aktuellen Ladestrom der Batterie und bei quota_soc um den aktuellen Ladezustand.
Aber der Rest ist doch sehr kryptisch, zumal einige Readings wohl nicht von einem Gerät direkt stammen sondern in einem anderen DOIF erst gebildet werden bsp total_f.day