FHEM Forum

FHEM - Hausautomations-Systeme => Sonstige Systeme => Thema gestartet von: Benni am 19 Mai 2019, 10:52:31

Titel: [gelöst]: 36_Shelly.pm - "[Shelly_onoff] returns without success, cmd=on ..."
Beitrag von: Benni am 19 Mai 2019, 10:52:31
Hallo Pah,

Da ich gestern quasi notfallmäßig dazu gezwungen war, endlich mal einen meiner Shelly 2 einzubinden, habe ich mich der Einfachheit halber für dein Shelly-Modul entschieden.

Es funktioniert so weit auch alles, allerdings werden bei jedem Shaltvorgang Meldungen der folgenden Art im Log eingetragen:


2019.05.19 06:29:15 1: [Shelly_onoff] returns without success, cmd=on but ison=true
2019.05.19 06:29:15 1: [Shelly_onoff] returns without success, cmd=on but ison=true
2019.05.19 06:29:18 1: [Shelly_onoff] returns without success, cmd=off but ison=false
2019.05.19 06:29:18 1: [Shelly_onoff] returns without success, cmd=off but ison=false


Ich habe mir dann mal den Code angeschaut, und letztendlich festgestellt, dass du im Modul für ison einen Wert von 1 (=on) oder 0 (=off) im JSON erwartest. Bei mir liefert der Shelly allerdings true (=on) und false (=off):


2019.05.19 06:53:17 4: [Shelly_Set] switching default channel 0
2019.05.19 06:53:17 5: [Shelly_onoff] Issue a non-blocking call to http://192.168.178.124:80/relay/0?turn=off
2019.05.19 06:53:17 5: [Shelly_onoff] has obtained data {"ison":false,"has_timer":false,"overpower":false,"is_valid":true}
2019.05.19 06:53:19 5: [Shelly_status] Issue a non-blocking call to http://192.168.178.124:80/status
2019.05.19 06:53:19 5: [Shelly_status] has obtained data {"wifi_sta":{"connected":true,"ssid":"BB IoT","ip":"192.168.178.124","rssi":-58},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"06:53","serial":1,"has_update":false,"mac":"84F3EB32BCC5","relays":[{"ison":false,"has_timer":false,"overpower":false,"is_valid":true},{"ison":false,"has_timer":false,"overpower":false,"is_valid":true}],"rollers":[{"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"stop_reason":"normal","last_direction":"stop","current_pos":101,"calibrating":false,"positioning":true}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1558248799,"counters":[13.223, 13.178, 3.791],"total":3062}],"update":{"status":"idle","has_update":false,"new_version":"20190415-154606/v1.4.9-hotfix3@e89b6ff3","old_version":"20190415-154606/v1.4.9-hotfix3@e89b6ff3"},"ram_total":50416,"ram_free":39192,"fs_size":233681,"fs_free":160891,"uptime":50065}
2019.05.19 06:54:19 5: [Shelly_status] Issue a non-blocking call to http://192.168.178.124:80/status
2019.05.19 06:54:19 5: [Shelly_status] has obtained data {"wifi_sta":{"connected":true,"ssid":"BB IoT","ip":"192.168.178.124","rssi":-59},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"06:54","serial":1,"has_update":false,"mac":"84F3EB32BCC5","relays":[{"ison":false,"has_timer":false,"overpower":false,"is_valid":true},{"ison":false,"has_timer":false,"overpower":false,"is_valid":true}],"rollers":[{"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"stop_reason":"normal","last_direction":"stop","current_pos":101,"calibrating":false,"positioning":true}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1558248859,"counters":[3.603, 13.223, 13.178],"total":3066}],"update":{"status":"idle","has_update":false,"new_version":"20190415-154606/v1.4.9-hotfix3@e89b6ff3","old_version":"20190415-154606/v1.4.9-hotfix3@e89b6ff3"},"ram_total":50416,"ram_free":39216,"fs_size":233681,"fs_free":160891,"uptime":50125}


Keine Ahnung, ob das von der Firmwareversion oder dem Shelly-Modell abhängt. Ich habe jedenfalls mal die beiden Code-Stellen im Modul so erweitert, dass zusätzlich  auch true und false korrekt in on und off umgesetzt werden.

Patch im Anhang!

Gruß und schönen Sonntag noch!
Benni.
Titel: Antw:[Patch]: 36_Shelly.pm - "[Shelly_onoff] returns without success, cmd=on but ..."
Beitrag von: Prof. Dr. Peter Henning am 19 Mai 2019, 11:05:49
OK, baue ich ein.

Kann mit der Firmware-Version zusammenhängen.

Wird dann aber erst eine Beta-Version sein, zu finden hier am Ende: https://forum.fhem.de/index.php/topic,93251.0.html

LG

pah
Titel: Antw:[Patch]: 36_Shelly.pm - "[Shelly_onoff] returns without success, cmd=on but ..."
Beitrag von: Benni am 20 Mai 2019, 07:15:10
Seit gestern Mittag mit der aktuellen Beta-Version im verlinkten Thread umgesetzt.

Danke Pah!

Damit schließe ich diesen Thread.