Hallo,
ich habe via MQTT2_SERVER
define myBroker MQTT2_SERVER 1883 global
setuuid myBroker 5d1e4efa-f33f-8319-c525-5b4xxx
Internals:
CONNECTS 2
DEF 1883 global
FD 10
FUUID 5d1e4efa-f33f-8319-c525-5b4xxx
NAME myBroker
NR 174
PORT 1883
STATE Initialized
TYPE MQTT2_SERVER
READINGS:
2019-08-02 19:27:59 RETAIN {"tele/Obi1/LWT":"Online","tele/sonoff/LWT":"Online"}
2019-08-02 19:27:59 nrclients 2
2019-08-02 19:27:45 state Initialized
clients:
myBroker_192.168.0.70_8802 1
myBroker_192.168.0.71_29358 1
retain:
tele/Obi1/LWT:
ts 1564766876.97737
val Online
tele/sonoff/LWT:
ts 1564766879.35858
val Online
Attributes:
eine Sonoff S20 Steckdose mit Tasmota Version 6.6.0(release-sonoff)
define Poolpumpe MQTT2_DEVICE DVES_B0B3EB
setuuid Poolpumpe 5d1f3d1b-f33f-8319-925c-56ca9dad6a973a49
attr Poolpumpe IODev myBroker
attr Poolpumpe autocreate 0
attr Poolpumpe devStateIcon .*on:on .*off:off on.(for.timer|till.*):on-for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
attr Poolpumpe group Pool
attr Poolpumpe icon scene_swimming
attr Poolpumpe model A_01a_tasmota_basic_state_power1
attr Poolpumpe readingList tele/sonoff/LWT:.* LWT\
tele/sonoff/STATE:.* { json2nameValue($EVENT) }\
tele/sonoff/SENSOR:.* { json2nameValue($EVENT) }\
tele/sonoff/INFO.:.* { json2nameValue($EVENT) }\
stat/sonoff/RESULT:.* { json2nameValue($EVENT) }
attr Poolpumpe room Garten
attr Poolpumpe setExtensionsEvent 1
attr Poolpumpe setList off:noArg cmnd/sonoff/POWER1 0\
on:noArg cmnd/sonoff/POWER1 1\
toggle:noArg cmnd/sonoff/POWER1 2
attr Poolpumpe setStateList on off toggle
attr Poolpumpe stateFormat POWER1
Internals:
CID DVES_B0B3EB
DEF DVES_B0B3EB
DEVICETOPIC Poolpumpe
FUUID 5d1f3d1b-f33f-8319-925c-56ca9dad6a973a49
IODev myBroker
LASTInputDev myBroker
MSGCNT 3
NAME Poolpumpe
NR 808
STATE off
STILLDONETIME 0
TYPE MQTT2_DEVICE
myBroker_MSGCNT 3
myBroker_TIME 2019-08-02 19:33:14
READINGS:
2019-08-02 18:02:38 FallbackTopic cmnd/DVES_331931_fb/
2019-08-02 18:02:38 GroupTopic sonoffs
2019-08-02 19:33:14 Heap 15
2019-08-02 18:02:38 Hostname sonoff-6449
2019-08-02 18:02:38 IPAddress 192.168.0.71
2019-07-04 10:48:28 Key on
2019-08-02 19:27:59 LWT Online
2019-08-02 19:33:14 LoadAvg 26
2019-08-02 18:02:38 Module OBI Socket 2
2019-07-14 18:57:42 OtaUrl http://thehackbox.org/tasmota/release/sonoff-DE.bin
2019-08-02 18:18:06 POWER OFF
2019-08-02 19:33:14 POWER1 off
2019-08-02 09:00:00 PoolpumpeAusZeit 2019-08-02 16:01:00
2019-08-02 09:00:00 PoolpumpeLaufZeit 07:01:00
2019-08-02 09:00:00 PoolpumpeOnForTimer 25272
2019-07-04 10:48:28 Relay on
2019-08-02 18:02:38 RestartReason Power on
2019-08-02 19:33:14 Sleep 50
2019-08-02 19:33:14 SleepMode Dynamic
2019-08-02 19:33:14 Time 2019-08-02T18:33:14
2019-07-14 18:57:43 Upgrade Version 6.5.0 from http://thehackbox.org/tasmota/release/sonoff-DE.bin
2019-08-02 19:33:14 Uptime 19T00:34:09
2019-07-14 18:53:15 Vcc 3.159
2019-08-02 18:02:38 Version 6.6.0(release-sonoff)
2019-08-02 18:02:38 WebServerMode Admin
2019-08-02 19:33:14 Wifi_AP 1
2019-08-02 19:33:14 Wifi_BSSId 38:10:D5:D7:EF:49
2019-08-02 19:33:14 Wifi_Channel 6
2019-08-02 19:33:14 Wifi_Downtime 4T07:45:17
2019-08-02 19:33:14 Wifi_LinkCount 53
2019-08-02 19:33:14 Wifi_RSSI 36
2019-08-02 19:33:14 Wifi_SSId Asterix
2019-07-05 14:41:35 presence absent
2019-08-02 18:56:44 state set_off
Attributes:
IODev myBroker
autocreate 0
devStateIcon .*on:on .*off:off on.(for.timer|till.*):on-for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
group Pool
icon scene_swimming
model A_01a_tasmota_basic_state_power1
readingList tele/sonoff/LWT:.* LWT
tele/sonoff/STATE:.* { json2nameValue($EVENT) }
tele/sonoff/SENSOR:.* { json2nameValue($EVENT) }
tele/sonoff/INFO.:.* { json2nameValue($EVENT) }
stat/sonoff/RESULT:.* { json2nameValue($EVENT) }
room Garten
setExtensionsEvent 1
setList off:noArg cmnd/sonoff/POWER1 0
on:noArg cmnd/sonoff/POWER1 1
toggle:noArg cmnd/sonoff/POWER1 2
setStateList on off toggle
stateFormat POWER1
in Betrieb, welche auch mit FHEM wunderbar funktioniert.
Nun möchte ich eine 2. (zweite) Steckdose, diesmal Obi Typ 2, auch mit Tasmota Version 6.6.0(release-sonoff) in FHEM nutzen. Die Obi-Steckdose funktioniert in der Tasmota Oberfläche.
Auch für die Obi-Steckdose habe ich ein Device analog zur Sonoff-S20-Steckdose angelegt:
define ObiSteckdose MQTT2_DEVICE DVES_331931
setuuid ObiSteckdose 5d41bb22-f33f-8319-23ac-2c71136f8b14fbee
attr ObiSteckdose IODev myBroker
attr ObiSteckdose autocreate 0
attr ObiSteckdose devStateIcon .*on:on .*off:off on.(for.timer|till.*):on-#for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
attr ObiSteckdose icon hue_filled_br30
attr ObiSteckdose readingList tele/obi/LWT:.* LWT\
tele/Obi1/STATE:.* { json2nameValue($EVENT) }\
tele/Obi1/SENSOR:.* { json2nameValue($EVENT) }\
tele/Obi1/INFO.:.* { json2nameValue($EVENT) }\
stat/Obi1/RESULT:.* { json2nameValue($EVENT) }
attr ObiSteckdose room Test
attr ObiSteckdose setExtensionsEvent 1
attr ObiSteckdose setList off:noArg cmnd/Obi1/POWER1 0\
on:noArg cmnd/Obi1/POWER1 1\
toggle:noArg cmnd/Obi1/POWER1 2
attr ObiSteckdose setStateList on off toggle
attr ObiSteckdose stateFormat POWER1
Internals:
CID DVES_331931
DEF DVES_331931
DEVICETOPIC ObiSteckdose
FUUID 5d41bb22-f33f-8319-23ac-2c71136f8b14fbee
IODev myBroker
LASTInputDev myBroker
MSGCNT 4
NAME ObiSteckdose
NR 1184
STATE off
TYPE MQTT2_DEVICE
myBroker_MSGCNT 4
myBroker_TIME 2019-08-02 19:37:44
READINGS:
2019-08-02 18:35:42 BASE 18
2019-08-02 18:35:42 FLAG 15
2019-08-02 18:35:54 FallbackTopic cmnd/DVES_331931_fb/
2019-08-02 18:35:42 GPIO_1 255
2019-08-02 18:35:42 GPIO_10 255
2019-08-02 18:35:42 GPIO_11 255
2019-08-02 18:35:42 GPIO_12 255
2019-08-02 18:35:42 GPIO_13 255
2019-08-02 18:35:42 GPIO_2 255
2019-08-02 18:35:42 GPIO_3 255
2019-08-02 18:35:42 GPIO_4 255
2019-08-02 18:35:42 GPIO_5 255
2019-08-02 18:35:42 GPIO_6 255
2019-08-02 18:35:42 GPIO_7 255
2019-08-02 18:35:42 GPIO_8 255
2019-08-02 18:35:42 GPIO_9 255
2019-08-02 18:35:54 GroupTopic sonoffs
2019-08-02 19:37:44 Heap 14
2019-08-02 18:35:54 Hostname Obi1-6449
2019-08-02 18:35:54 IPAddress 192.168.0.71
2019-08-02 19:26:56 LWT Online
2019-08-02 19:37:44 LoadAvg 19
2019-08-02 18:35:54 Module OBI Socket 2
2019-08-02 18:35:42 NAME Generic
2019-08-02 19:37:44 POWER OFF
2019-08-02 18:19:52 POWER1 off
2019-08-02 18:35:54 RestartReason Software/System restart
2019-08-02 19:37:44 Sleep 50
2019-08-02 19:37:44 SleepMode Dynamic
2019-08-02 19:37:44 Time 2019-08-02T18:37:44
2019-08-02 19:37:44 Uptime 0T01:01:59
2019-08-02 18:35:54 Version 6.6.0(release-sonoff)
2019-08-02 18:35:54 WebServerMode Admin
2019-08-02 19:37:44 Wifi_AP 1
2019-08-02 19:37:44 Wifi_BSSId 38:10:D5:D7:EF:49
2019-08-02 19:37:44 Wifi_Channel 6
2019-08-02 19:37:44 Wifi_Downtime 0T00:00:07
2019-08-02 19:37:44 Wifi_LinkCount 1
2019-08-02 19:37:44 Wifi_RSSI 100
2019-08-02 19:37:44 Wifi_SSId Asterix
2019-08-02 18:45:12 off set
2019-08-02 18:45:10 on set
2019-08-02 19:29:22 state set_off
Attributes:
IODev myBroker
autocreate 0
devStateIcon .*on:on .*off:off on.(for.timer|till.*):on-#for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
icon hue_filled_br30
readingList tele/obi/LWT:.* LWT
tele/Obi1/STATE:.* { json2nameValue($EVENT) }
tele/Obi1/SENSOR:.* { json2nameValue($EVENT) }
tele/Obi1/INFO.:.* { json2nameValue($EVENT) }
stat/Obi1/RESULT:.* { json2nameValue($EVENT) }
room Test
setExtensionsEvent 1
setList off:noArg cmnd/Obi1/POWER1 0
on:noArg cmnd/Obi1/POWER1 1
toggle:noArg cmnd/Obi1/POWER1 2
setStateList on off toggle
stateFormat POWER1
Die Obi-Steckdose lässt sich in der FHEM Oberfläche mit "on" bzw. "off" schalten.
Jedoch:
- geht "toggle" nur von aus --> an aber nicht von an --> aus. Ausschalten läst sich die Obi-Dose nur mit Klick auf "off"
- Weiterhin geht das Icon nicht auf "on" sondern ist immer auf aus, egal welchen Zustand die Steckdose hat
Die Fehler sind nur bei der Obi-Steckdose, nicht bei der Sonoff-Steckdose.
Was ist falsch?
Ich bitte um Hilfe, damit
A) das Icon-Symbol hin und her toggled und
B) via Klick auf das Icon-Symbol die Obi-Steckdose jeweils nach an bzw. aus toggelt.
Mit lieben Grüßen
Bracew
ZitatInternals:
CID DVES_331931
DEF DVES_331931
DEVICETOPIC ObiSteckdose
FUUID 5d41bb22-f33f-8319-23ac-2c71136f8b14fbee
IODev myBroker
LASTInputDev myBroker
MSGCNT 4
NAME ObiSteckdose
NR 1184
STATE off
TYPE MQTT2_DEVICE
myBroker_MSGCNT 4
myBroker_TIME 2019-08-02 19:37:44
READINGS:
2019-08-02 18:35:42 BASE 18
2019-08-02 18:35:42 FLAG 15
2019-08-02 18:35:54 FallbackTopic cmnd/DVES_331931_fb/
2019-08-02 18:35:42 GPIO_1 255
2019-08-02 18:35:42 GPIO_10 255
2019-08-02 18:35:42 GPIO_11 255
2019-08-02 18:35:42 GPIO_12 255
2019-08-02 18:35:42 GPIO_13 255
2019-08-02 18:35:42 GPIO_2 255
2019-08-02 18:35:42 GPIO_3 255
2019-08-02 18:35:42 GPIO_4 255
2019-08-02 18:35:42 GPIO_5 255
2019-08-02 18:35:42 GPIO_6 255
2019-08-02 18:35:42 GPIO_7 255
2019-08-02 18:35:42 GPIO_8 255
2019-08-02 18:35:42 GPIO_9 255
2019-08-02 18:35:54 GroupTopic sonoffs
2019-08-02 19:37:44 Heap 14
2019-08-02 18:35:54 Hostname Obi1-6449
2019-08-02 18:35:54 IPAddress 192.168.0.71
2019-08-02 19:26:56 LWT Online
2019-08-02 19:37:44 LoadAvg 19
2019-08-02 18:35:54 Module OBI Socket 2
2019-08-02 18:35:42 NAME Generic
2019-08-02 19:37:44 POWER OFF
2019-08-02 18:19:52 POWER1 off
2019-08-02 18:35:54 RestartReason Software/System restart
2019-08-02 19:37:44 Sleep 50
2019-08-02 19:37:44 SleepMode Dynamic
2019-08-02 19:37:44 Time 2019-08-02T18:37:44
2019-08-02 19:37:44 Uptime 0T01:01:59
2019-08-02 18:35:54 Version 6.6.0(release-sonoff)
2019-08-02 18:35:54 WebServerMode Admin
2019-08-02 19:37:44 Wifi_AP 1
2019-08-02 19:37:44 Wifi_BSSId 38:10:D5:D7:EF:49
2019-08-02 19:37:44 Wifi_Channel 6
2019-08-02 19:37:44 Wifi_Downtime 0T00:00:07
2019-08-02 19:37:44 Wifi_LinkCount 1
2019-08-02 19:37:44 Wifi_RSSI 100
2019-08-02 19:37:44 Wifi_SSId Asterix
2019-08-02 18:45:12 off set
2019-08-02 18:45:10 on set
2019-08-02 19:29:22 state set_off
Attributes:
IODev myBroker
autocreate 0
devStateIcon .*on:on .*off:off on.(for.timer|till.*):on-#for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
icon hue_filled_br30
readingList tele/obi/LWT:.* LWT
tele/Obi1/STATE:.* { json2nameValue($EVENT) }
tele/Obi1/SENSOR:.* { json2nameValue($EVENT) }
tele/Obi1/INFO.:.* { json2nameValue($EVENT) }
stat/Obi1/RESULT:.* { json2nameValue($EVENT) }
room Test
setExtensionsEvent 1
setList off:noArg cmnd/Obi1/POWER1 0
on:noArg cmnd/Obi1/POWER1 1
toggle:noArg cmnd/Obi1/POWER1 2
setStateList on off toggle
stateFormat POWER1
Da ist dir beim anlegen ein kleiner Fehler unterlaufen. :)
Übrigens muss man das MQTT2_DEVICE nicht manuell erstellen, sind die MQTT-Einstellungen einmal vorgenommen reicht schon die Spannungsversorgung der Steckdose das ein neues Device automatisch angelegt wird. Alternativ auch ein schalten aus der Oberfläche der Steckdose.
Auf dieses wendet man dann das entsprechende Template an, dann wäre dir das gar nicht passiert
Gruß
Thomas
Danke für den #-Fehlerhinweis. Habe ich korrigiert, jedoch keine Änderung im Schaltverhalten. Das Icon bleibt immer aus und ein Klick auf das Icon toggelt immer noch nur in eine Richtung. :-\
Anfangs habe ich das MQTT2_DEVICE nicht manuell erstellt, sondern automatisch anlegen lassen. Ein schalten aus der Oberfläche der Steckdose funktioniert. Auch aus FHEM funktioniert AN bzw. AUS, aber nicht das Umschalten per Klick auf das Lämpchen-Icon.
Das "Problem" ist, dass du das Reading "state" setzt, aber die Rückmeldung auf "POWER1" kommt. stateFormat betreibt hier nur Kosmetik... Also entweder korrigierst du das an der Wurzel oder du schreibst eben explizit noch den Befehl hinter die Icons in devStateIcon (als 3. Argument, wie bei den on/off-for; die sehen m.E. auch nicht "sauber" aus).
Aber eigentlich ist die Logik dazu in den Templates drin, wie TomLee ja bereits angemerkt hat. Ggf. mußt du halt noch das zigbee-devStateIcon verwenden (Perl-Code, der in dem MQtt2_DEVICE-Modul enthalten ist; bitte selber suchen).
Also, die ohne 3. Argument habe ich von Dir:
https://forum.fhem.de/index.php?topic=99653.0 bzw. https://forum.fhem.de/index.php/topic,101687.msg955843.html#msg955843
Ok, aber auch wenn ich ergänze:
attr ObiSteckdose devStateIcon .*on:on:off .*off:off:on on.(for.timer|till.*):on-for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
ändert sich am Verhalten nichts.
Mit:
attr ObiSteckdose devStateIcon {zigbee2mqtt_devStateIcon255($name,'hex',1)}
anstatt:
attr ObiSteckdose devStateIcon .*on:on:off .*off:off:on on.(for.timer|till.*):on-for-timer:off off.(for.timer|till.*):off-for-timer:on blink.*:light_toggle:off
wechselt nun das Symbol beim Klick auf "on" und auch beim Klick auf "off" aber nicht beim Klick auf das Icon, obwohl auch dann die Steckdose schaltet.
Mit
attr ObiSteckdose devStateIcon {zigbee2mqtt_devStateIcon255($name,'',1)}
ist es "fast" gut. Nur beim Klick auf das Icon wenn es AN ist wechselt es nicht auf AUS. Andersrum schon.
Hmm, vermutlich ist und bleibt das "Problem", dass beim Auspacken des JSON der "Rückweg" nach POWER1 führt und nicht in "state". (Ist leider bei den Tasmotas etwas anders als bei anderen Device-Typen).
Kann mich leider grad nicht intensiver drum kümmern, aber versuche mal "toggle" als 3. Argument.
Funktioniert schlechter.
Klick auf "on" und "off" geht. Klick auf toggle geht nicht. Anzeige des "Birnchen" schaltet nicht um.
Hallo,
ich habe immer noch an meiner Obi Type2 Steckdose das Problem, dass beim toggeln die Anzeige immer nur "An" geht, aber nicht "Aus". Die Steckdose schaltet hin und her, das Birnchen bleibt an.
Beim Klick auf "on" bzw. "off" läuft alles richtig. Steckdose schaltet hin und her, Birnchen wechselt hin und her.
Jemand eine Idee?
Gruß Bracew
Hallo,
mit dem Status hatte ich auch Probleme. Das habe ich inzwischen so gelöst:
stateFormat {lc ReadingsVal($name, "POWER1", "")
VG
(;-)Mi
Hi, danke für Deinen Tipp.
Leider jedoch keine Änderung des Verhaltens. Wenn die Steckdose an ist und das Birnchen leuchtet, schaltet die Steckdose beim Klick auf das leuchtende Birnchen-Symbol zwar aus, das Birnchen-Symbol ändert sich aber nicht, es bleibt auf an bzw. gelb leuchtend. Nur mit dem Klick auf "off" geht die Steckdose aus und auch das Birnchen-Symbol auf grau bzw. aus.
Gruß Bracew
Hallo zusammen,
ich habs nun gelöst bekommen.
# #################################################################
# Obi-WLAN-Tasmota-MQTT-Funksteckdose schalten
# Auf Steckdosen eigener Oberflaeche: http://192.168.0.71/mq
# unter MQTT-Konfigurieren muss fuer jede Steckdose ein eigenes
# Topic konfiguriert werden, hier: Obi1
# Das Topic muss in den FHEM Attributen verwendet werden.
# #################################################################
#
define ObiSteckdose MQTT2_DEVICE DVES_33xxxx
setuuid ObiSteckdose 5d41bb22-f33f-yyyy
attr ObiSteckdose IODev myBroker
attr ObiSteckdose readingList \
DVES_33xxxx:tele/Obi1/STATE:.* { json2nameValue($EVENT) }\
DVES_33xxxx:tele/Obi1/LWT:.* LWT\
DVES_33xxxx:cmnd/Obi1/POWER:.* POWER\
DVES_33xxxx:tele/Obi1/UPTIME:.* { json2nameValue($EVENT) }\
DVES_33xxxx:tele/Obi1/SENSOR:.* { json2nameValue($EVENT) }\
DVES_33xxxx:tele/Obi1/INFO1:.* { json2nameValue($EVENT) }\
DVES_33xxxx:tele/Obi1/INFO2:.* { json2nameValue($EVENT) }\
DVES_33xxxx:tele/Obi1/INFO3:.* { json2nameValue($EVENT) }\
DVES_33xxxx:stat/Obi1/RESULT:.* { json2nameValue($EVENT) }\
DVES_33xxxx:stat/Obi1/STATE:.* { json2nameValue($EVENT) }\
DVES_33xxxx:stat/Obi1/POWER:.* POWER
attr ObiSteckdose setList \
on cmnd/Obi1/POWER on\
off cmnd/Obi1/POWER off
attr ObiSteckdose webCmd on:off
attr ObiSteckdose icon hue_filled_br30
attr ObiSteckdose room Test
#
Schalten und auch Lämpchen-Anzeige geht wunderbar!
Danke für alle Hilfe und mit lieben Grüßen Bracew