Modul 36_Shelly.pm

Begonnen von Prof. Dr. Peter Henning, 15 November 2018, 10:24:39

Vorheriges Thema - Nächstes Thema

Prof. Dr. Peter Henning

@Prostetnik: Wundert mich, das ist eigentlich ordentlich implementiert. Gibt es irgendwas dazu im Log?

LG

pah



Prostetnik

Mit Verbose=5:
2021.01.01 08:21:31 5 : [Shelly_onoff] Issue a non-blocking call to http://192.168.123.52/relay/0?turn=on&timer=10
2021-01-01 08:21:31 Shelly Sh_Plug2 on-for-timer 10
2021.01.01 08:21:32 5 : [Shelly_onoff] has obtained data {"ison":true,"has_timer":true,"timer_started":1609489292,"timer_duration":10,"timer_remaining":10,"overpower":false,"source":"http"}
2021-01-01 08:21:32 Shelly Sh_Plug2 on
2021-01-01 08:21:32 Shelly Sh_Plug2 relay: on
2021-01-01 08:21:32 Shelly Sh_Plug2 overpower: 0
2021.01.01 08:21:32 5 : [Shelly_onoff] Issue a non-blocking call to http://192.168.123.52/relay/0?turn=on
2021-01-01 08:21:32 Shelly Sh_Plug2 on 1
2021.01.01 08:21:32 5 : [Shelly_onoff] has obtained data {"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"http"}
2021-01-01 08:21:32 Shelly Sh_Plug2 relay: on
2021-01-01 08:21:32 Shelly Sh_Plug2 overpower: 0
2021.01.01 08:21:32 5 : [Shelly_onoff] Issue a non-blocking call to http://192.168.123.52/relay/0?turn=on
2021-01-01 08:21:32 Shelly Sh_Plug2 on 1
2021.01.01 08:21:32 5 : [Shelly_onoff] has obtained data {"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"http"}
2021-01-01 08:21:32 Shelly Sh_Plug2 relay: on
2021-01-01 08:21:32 Shelly Sh_Plug2 overpower: 0
2021.01.01 08:21:33 5 : [Shelly_status] Issue a non-blocking call to http://192.168.123.52/status
2021.01.01 08:21:33 5 : [Shelly_status] Issue a non-blocking call to http://192.168.123.52/status
2021.01.01 08:21:33 5 : [Shelly_status] Issue a non-blocking call to http://192.168.123.52/status
2021.01.01 08:21:33 5 : [Shelly_status] has obtained data {"wifi_sta":{"connected":true,"ssid":"StevesWirelessNetwork_FB","ip":"192.168.123.52","rssi":-52},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"08:21","unixtime":1609485693,"serial":3043,"has_update":false,"mac":"F4CFA26CBF31","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"http"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1609489293,"counters":[0.000, 0.000, 0.000],"total":29260}],"update":{"status":"idle","has_update":false,"new_version":"20201228-092942/v1.9.3@ad2bb4e3","old_version":"20201228-092942/v1.9.3@ad2bb4e3","beta_version":"20201202-141133/v1.9.3-rc3@50c6ab57"},"ram_total":51056,"ram_free":36000,"fs_size":233681,"fs_free":160389,"uptime":140236}
2021.01.01 08:21:33 5 : [Shelly_status] has obtained data {"wifi_sta":{"connected":true,"ssid":"StevesWirelessNetwork_FB","ip":"192.168.123.52","rssi":-52},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"08:21","unixtime":1609485693,"serial":3043,"has_update":false,"mac":"F4CFA26CBF31","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"http"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1609489293,"counters":[0.000, 0.000, 0.000],"total":29260}],"update":{"status":"idle","has_update":false,"new_version":"20201228-092942/v1.9.3@ad2bb4e3","old_version":"20201228-092942/v1.9.3@ad2bb4e3","beta_version":"20201202-141133/v1.9.3-rc3@50c6ab57"},"ram_total":51056,"ram_free":36796,"fs_size":233681,"fs_free":160389,"uptime":140236}
2021.01.01 08:21:33 5 : [Shelly_status] has obtained data {"wifi_sta":{"connected":true,"ssid":"StevesWirelessNetwork_FB","ip":"192.168.123.52","rssi":-52},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"08:21","unixtime":1609485693,"serial":3043,"has_update":false,"mac":"F4CFA26CBF31","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"http"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1609489293,"counters":[0.000, 0.000, 0.000],"total":29260}],"update":{"status":"idle","has_update":false,"new_version":"20201228-092942/v1.9.3@ad2bb4e3","old_version":"20201228-092942/v1.9.3@ad2bb4e3","beta_version":"20201202-141133/v1.9.3-rc3@50c6ab57"},"ram_total":51056,"ram_free":37600,"fs_size":233681,"fs_free":160389,"uptime":140236}

.
.
.
.
.
.
[das Folgende wiederholt sich dann alle 60s]

2021.01.01 08:22:33 5 : [Shelly_status] Issue a non-blocking call to http://192.168.123.52/status
2021.01.01 08:22:33 5 : [Shelly_status] has obtained data {"wifi_sta":{"connected":true,"ssid":"StevesWirelessNetwork_FB","ip":"192.168.123.52","rssi":-52},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"08:22","unixtime":1609485753,"serial":3045,"has_update":false,"mac":"F4CFA26CBF31","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"http"}],"meters":[{"power":95.49,"overpower":0.00,"is_valid":true,"timestamp":1609489353,"counters":[85.568, 0.000, 0.000],"total":29346}],"update":{"status":"idle","has_update":false,"new_version":"20201228-092942/v1.9.3@ad2bb4e3","old_version":"20201228-092942/v1.9.3@ad2bb4e3","beta_version":"20201202-141133/v1.9.3-rc3@50c6ab57"},"ram_total":51056,"ram_free":39280,"fs_size":233681,"fs_free":160389,"uptime":140296}

Prof. Dr. Peter Henning

Der erste on-for-timer-Befehl wird richtig übermittelt und erkannt. Woher kommt in derselben Sekunde der on-Befehl? Das Modul setzt so etwas nicht von alleine ab.

Kann es sein, dass in dem Action-Feld im Shelly ein falscher Eintrag ist ?

LG

pah

Prostetnik

#678
Hmm. Ich habe natürlich die URL's gesetzt, damit ich die Schaltzustände in FHEM erfasse:

Url to be hit when the output is switched ON
http://192.168.123.81:8083/fhem?XHR=1&cmd=set%20Sh_Plug2%20on%201

Url to be hit when the output is switched OFF
http://192.168.123.81:8083/fhem?XHR=1&cmd=set%20Sh_Plug2%20off%201

Prostetnik

Ok, ich denke ich hab's verstanden. Aber wie kriege ich dann die Info, wenn man die Teile manuell ein- oder ausschaltet?

JWRu

ZitatAber wie kriege ich dann die Info, wenn man die Teile manuell ein- oder ausschaltet?
An beiden Stellen:
http://192.168.123.81:8083/fhem?XHR=1&cmd=get%20Sh_Plug2%20status
Dann holt FHEM sich den neuen Status.
ZBox; RasPi 3B; RasPi Zero W; Homematic; Z-Wave; EnOcean, Shelly; DuoFern; Oregon-Sensoren; TFA-Sensoren; Steuerung Viessmann-Heizung; Arduinos für Strom-, Wasser-, Gaszähler, Rauchmelder und FI-Schutzschalter

Wzut

Verstehe ich das richtig, Taster am Shelly drücken , der sagt "FHEM frag mich mal nach meinem neuen Status" , FHEM "shelly status ?" , Shelly "on"
Muss man das Ping-Pong Spiel wirklich spielen oder kann nicht gleich im Shelly ein setreading shelly on/off absetzen ?
Maintainer der Module: MAX, MPD, UbiquitiMP, UbiquitiOut, SIP, BEOK, readingsWatcher

JWRu

Für einen Plug geht das sicher auch. Ich nutze das für einen Dimmer - da wird dann auch die Dimmstufe abgeholt. Auf die hat man mit der URL keinen Zugriff.
ZBox; RasPi 3B; RasPi Zero W; Homematic; Z-Wave; EnOcean, Shelly; DuoFern; Oregon-Sensoren; TFA-Sensoren; Steuerung Viessmann-Heizung; Arduinos für Strom-, Wasser-, Gaszähler, Rauchmelder und FI-Schutzschalter

gvzdus

Mein erster Wurf des CoIoT-Moduls ist jetzt fertig, siehe hier: https://forum.fhem.de/index.php/topic,117309.0.html
Ich bitte um Gnade im Falle des FHEM-Crashes, aber ich denke, dem Einen oder Anderen könnte es gefallen.

Prostetnik

Zitat von: JWRu am 01 Januar 2021, 13:32:20
An beiden Stellen:
http://192.168.123.81:8083/fhem?XHR=1&cmd=get%20Sh_Plug2%20status
Dann holt FHEM sich den neuen Status.

Funktioniert! Danke!

Jogi

Hallo,
ich habe immer mal wieder Error-Meldungen bei einzelnen Shelly-Devices und kann nicht erkennen, woran es liegt oder wie ich es beheben kann.
Hier mal ein aktuelles list:
Internals:
   DEF        192.168.178.161
   DURATION   0
   FUUID      5fdc9c0a-f33f-8efe-0f71-658fc6f4046bf28b
   INTERVAL   15
   NAME       Kueche_rechts
   NR         3015
   STATE      Error
   TCPIP      192.168.178.161
   TYPE       Shelly
   READINGS:
     2020-12-18 13:09:48   cloud           disabled
     2021-01-02 19:44:54   firmware        v1.9.0
     2021-01-05 12:13:42   network         not connected
     2020-12-23 09:59:12   relay           off
     2021-01-05 12:13:42   state           Error
Attributes:
   group      group EG,Kueche
   icon       scene_dinner
   interval   15
   model      shelly1
   room       1.Start,Shelly
   sortby     964
   userattr   LichtAlarm LichtAlarm_map structexclude
   webCmd     :

Das Gerät ist über die IP-Adresse im Web ganz normal erreich- und steuerbar. Kein Fehler -für mich- erkennbar.
Ich kann es aber über FHEM nicht steuern und bekomme auch kein Status-Anzeigen in FHEM.

Über
get Kueche_rechts status
erhalte ich
Kueche_rechts status => ok.
Im Logfile des letzten Kontaktages finde ich folgendes:
2021.01.02 05:58:05 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
Die Software des Shelly ist aktuell. 

In der Regel ist es manchmal -aber nicht immer- so, dass ein reboot des Shelly wieder alles auf normal setzt.
Wenn das nicht hilft, muss FHEM über shutdown restart neu gestartet werden.
Danach ist alles wieder normal, bis zum nächsten Error in ein paar Tagen oder Wochen.
list sieht dann -nach shutdown restart- so aus:
Internals:
   DEF        192.168.178.161
   DURATION   0
   FUUID      5fdc9c0a-f33f-8efe-0f71-658fc6f4046bf28b
   INTERVAL   15
   NAME       Kueche_rechts
   NR         3011
   STATE      off
   TCPIP      192.168.178.161
   TYPE       Shelly
   READINGS:
     2020-12-18 13:09:48   cloud           disabled
     2021-01-05 12:53:06   firmware        v1.9.3
     2021-01-05 12:52:43   network         <html>connected to <a href="http://192.168.178.161">192.168.178.161</a></html>
     2020-12-23 09:59:12   relay           off
     2021-01-05 12:53:06   state           off
Attributes:
   group      group EG,Kueche
   icon       scene_dinner
   interval   15
   model      shelly1
   room       1.Start,Shelly
   sortby     964
   userattr   LichtAlarm LichtAlarm_map structexclude
   webCmd     :



Hat jemand eine Idee dazu?




amenomade

ZitatIm Logfile des letzten Kontaktages finde ich folgendes:
2021.01.02 05:58:05 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out

Hast Du das nur einmal, oder mehrmals nacheinander?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

MadMax-FHEM

Zitat von: amenomade am 05 Januar 2021, 13:19:04
Hast Du das nur einmal, oder mehrmals nacheinander?

Jep, siehe auch dort: https://forum.fhem.de/index.php/topic,117169.msg1115400.html#msg1115400

Wenn nur 1x (oder sehr ab und an) dann ist halt das Modul zu "ungeduldig" (ohne jetzt als "Beschwerde" verstanden zu werden ;) ) gegenüber einem Browser, der schon mal länger versucht, ob nicht doch was zu laden ist.
Daher kannst du (evtl.) mit dem Browser nichts feststellen und denkst: IMMER alles ok. (aber vielleicht manchmal nicht ganz so ok ;)  )...

Wenn öfter/häufig: dann mal bzgl. Netzwerk prüfen (und noch mal: ein Browser ist sicher "geduldiger" ;) )...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

JWRu

Ich habe das auch ab und zu - ist kein Problem.
ZBox; RasPi 3B; RasPi Zero W; Homematic; Z-Wave; EnOcean, Shelly; DuoFern; Oregon-Sensoren; TFA-Sensoren; Steuerung Viessmann-Heizung; Arduinos für Strom-, Wasser-, Gaszähler, Rauchmelder und FI-Schutzschalter

Jogi

Zitat von: amenomade am 05 Januar 2021, 13:19:04
Hast Du das nur einmal, oder mehrmals nacheinander?
Ich habe das schon häufiger im log:
2021.01.02 19:47:29 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:47:48 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:48:08 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out

2021.01.02 19:48:27 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:48:47 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:49:06 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:49:15 3: sduino IT_set: Garage_Vorne off
2021.01.02 19:49:16 3: sduino433Mhz IT: Kueche_3 off->off
2021.01.02 19:49:16 3: sduino433Mhz IT: Garage_Vorne off->off
2021.01.02 19:49:25 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:49:45 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:50:04 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:50:23 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:50:43 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:51:02 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:51:21 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:51:41 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:51:48 3: CUL_HM set Warmwasserpumpe off noArg
2021.01.02 19:52:00 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:52:20 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:52:39 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:52:58 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:53:18 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:53:23 3: CUL_HM set Deckenlampe_Flur off noArg
2021.01.02 19:53:37 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:53:56 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:54:15 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:54:35 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:54:54 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:54:58 3: LED_Kueche: EspLedController_RGB2HSV: 429.258823529412 - 76.2235294117647 - 393.152941176471
2021.01.02 19:55:13 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:55:32 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:55:52 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:56:11 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:56:30 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:56:37 3: LED_Kueche: EspLedController_RGB2HSV: 1023 - 1023 - 1023
2021.01.02 19:56:50 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:57:09 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:57:28 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:57:48 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:58:07 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:58:27 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:58:46 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:59:05 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:59:25 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out
2021.01.02 19:59:44 1: [Shelly_status]  has error connect to http://192.168.178.161:80 timed out

Zum Netzwerk:
Ich habe ein Unify Netzwerk. Normalerweise habe ich damit kein Probleme.
Signal am Shelly: WiFi RSSI: -67 dBm