Zitat von: biopio am 02 Mai 2024, 13:47:07Hallo, @epek!
Vielen Dank erst einmal für den Hinweis, dass in Zeile 404 eine Einrückung etwas verschoben ist.
Zitat von: biopio am 02 Mai 2024, 13:47:07Leider kann ich aus Deiner Frage nicht genau nachvollziehen, was denn jetzt genau nicht funktioniert. Hast Du das Tutorial auf der GitHub-Seite auch schon gelesen? Da ist auch ein kleines Beispiel-Script dabei.
Zitat von: biopio am 02 Mai 2024, 13:47:07Die Fragen, woher die Dosen eigentlich wissen, in welches Netzwerk sie sich einloggen sollen, kann ich Dir leider nicht beantworten.
Zitat von: biopio am 02 Mai 2024, 13:47:07Vielleicht kann aus dem UDP-Header die sendende IP-Adresse des Broadcasters ausgelesen werden?
Zitat von: biopio am 02 Mai 2024, 13:47:07Ich kann Dir aber sagen, dass es funktioniert. Ich hatte seinerzeit über Kleinanzeigen noch Silvercrest SWS-A1-Dosen bekommen und konnte sie mit dem send_password()-Kommando anmelden. Das Netzwerk muss dazu nicht offen sein.
Also, wo ist jetzt genau das Problem? Verbindet sich die Dose nicht?
1. Wenn Deine Dosen bisher funktioniert haben und auch schon im Netzwerk angemeldet waren, brauchst Du ihnen nicht erneut das Passwort zu senden. Das brauchst Du nur, wenn Du ein neues Passwort eingerichtet hast oder die Dosen in ein neues WLAN gepackt hast. Vielleicht probierst Du einfach mal:my_sockets = ws.find_sockets()
?
2. Es kann auch helfen, send_password einfach noch mal zu wiederholen.
Versuch mal, klarer zu beschreiben, was Du machst und was passiert bzw. nicht passiert. Welche Dosen hast Du, wann haben die das letzte Mal funktioniert? (Ich benutze z.B. einige nur zu Weihnachten, und da kann es auch schon mal sein, dass eine Dose dann doch mittlerweile kaputt ist).
defmod ATSolarForecastLoop at +*00:00:10 \
{\
my $idx = ReadingsNum($SELF,'idx',0);;\
#my @fcs = defInfo('TYPE=SolarForecast','NAME');;\
my @fcs = ("Forecast","ForecastDWD","ForecastOpenMeteo","ForecastOpenMeteoEnsemble","ForecastOpenMeteoWorld","ForecastSolarAPI","ForecastVictronVRM");;\
$idx = ($idx >= (@fcs-1))?0:($idx += 1);;\
\
my $sftimer = "at.".$fcs[$idx].".getdata.timer";;\
fhem("delete ".$sftimer );; \
fhem("define ".$sftimer ." at +00:00:01 get ".$fcs[$idx]." data");;\
fhem("attr ".$sftimer ." room AT");;\
\
fhem("setreading $SELF idx $idx");;\
fhem("setreading $SELF fc $fcs[$idx]");;\
}
attr ATSolarForecastLoop DbLogExclude .*
attr ATSolarForecastLoop room AT
2024-05-02 16:31:29.338 SolarForecast ForecastVictronVRM RestOfDayPVforecast: 5003 Wh
2024-05-02 16:31:39.281 SolarForecast Forecast NextHours_Sum02_PVforecast: 5658 Wh
2024-05-02 16:31:39.281 SolarForecast Forecast RestOfDayPVforecast: 7343 Wh
2024-05-02 16:31:49.246 SolarForecast ForecastDWD RestOfDayPVforecast: 5846 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo Today_Hour17_PVreal: 1000 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo Today_PVreal: 56019 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo NextHours_Sum01_PVforecast: 1974 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo NextHours_Sum02_PVforecast: 2514 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo NextHours_Sum03_PVforecast: 2951 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo NextHours_Sum04_PVforecast: 3090 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo RestOfDayPVforecast: 3132 Wh
2024-05-02 16:31:59.332 SolarForecast ForecastOpenMeteo RestOfDayConsumptionForecast: 7630 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble Today_Hour17_PVreal: 1000 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble Today_PVreal: 56019 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble NextHours_Sum01_PVforecast: 2609 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble NextHours_Sum02_PVforecast: 3560 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble NextHours_Sum03_PVforecast: 4008 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble NextHours_Sum04_PVforecast: 4212 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble RestOfDayPVforecast: 4262 Wh
2024-05-02 16:32:09.946 SolarForecast ForecastOpenMeteoEnsemble RestOfDayConsumptionForecast: 7604 Wh
2024-05-02 16:32:20.251 SolarForecast ForecastOpenMeteoWorld RestOfDayPVforecast: 3068 Wh
2024-05-02 16:32:29.241 SolarForecast ForecastSolarAPI NextHours_Sum03_PVforecast: 4692 Wh
2024-05-02 16:32:29.241 SolarForecast ForecastSolarAPI NextHours_Sum04_PVforecast: 4785 Wh
2024-05-02 16:32:29.241 SolarForecast ForecastSolarAPI RestOfDayPVforecast: 4785 Wh
2024-05-02 16:32:29.241 SolarForecast ForecastSolarAPI Today_PVdeviation: -37.12 %
2024-05-02 16:32:39.445 SolarForecast ForecastVictronVRM NextHours_Sum04_PVforecast: 4931 Wh
2024-05-02 16:32:39.445 SolarForecast ForecastVictronVRM RestOfDayPVforecast: 4946 Wh
2024-05-02 16:32:39.445 SolarForecast ForecastVictronVRM RestOfDayConsumptionForecast: 7392 Wh
2024-05-02 16:32:49.145 SolarForecast Forecast Today_Hour17_PVreal: 1010 Wh
2024-05-02 16:32:49.145 SolarForecast Forecast Today_PVreal: 56080 Wh
2024-05-02 16:32:49.145 SolarForecast Forecast RestOfDayPVforecast: 7293 Wh
2024-05-02 16:32:49.145 SolarForecast Forecast RestOfDayConsumptionForecast: 7427 Wh