Hallo,
ich kriege o.g. einfach nicht ans laufen, kann jemand helfen?
Info: Das Teil wurde per autocreate angelegt am tasmota kann ich einwandfrei beide Power schalten (230v und 5v usb) aber von fhem aus nicht?
hier die autoconfig:
#-----------------------------------------------------------------
########### Gosund SP 112 ##############################
#-----------------------------------------------------------------
define MQTT2_Gosund_SP112 MQTT2_DEVICE Gosund_SP112
setuuid MQTT2_Gosund_SP112 5e3edcb4-f33f-20ab-7d89-b1294f58112805ab
attr MQTT2_Gosund_SP112 IODev m2server
attr MQTT2_Gosund_SP112 autocreate 0
attr MQTT2_Gosund_SP112 comment NOTE: For on-for-timer SetExtensions are used. You may add on-for-timer option running on the device. The following is limited to 1h max duration, but will not affect future simple "on" commands:<br>on-for-timer {my $duration = $EVTPART1*10;; 'cmnd/CMNDTOPIC/Backlog POWER1 1;; delay '.$duration.';; POWER1 0'}<br>See the "Praxisbeispiele" in the wiki for "pulseTime1" alternative option and it's restrictions.
attr MQTT2_Gosund_SP112 icon hue_filled_outlet
attr MQTT2_Gosund_SP112 jsonMap POWER1:0 POWER2:0 POWER3:0 POWER4:0 Dimmer:0 Channel_0:0 Channel_1:0 Channel_2:0 Channel_3:0 Channel_4:0 HSBColor:0 Color:0
attr MQTT2_Gosund_SP112 model tasmota_basic_state_power1
attr MQTT2_Gosund_SP112 readingList TELETOPIC/LWT:.* LWT\
TELETOPIC/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }\
TELETOPIC/SENSOR:.* { json2nameValue($EVENT,'',$JSONMAP) }\
TELETOPIC/INFO.:.* { json2nameValue($EVENT,'',$JSONMAP) }\
TELETOPIC/UPTIME:.* { json2nameValue($EVENT,'',$JSONMAP) }\
TELETOPIC/POWER1:.* state\
STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
attr MQTT2_Gosund_SP112 room MQTT2_DEVICE
attr MQTT2_Gosund_SP112 setList off:noArg CMNDTOPIC/POWER1 0\
on:noArg CMNDTOPIC/POWER1 1\
toggle:noArg CMNDTOPIC/POWER1 2\
setOtaUrl:textField CMNDTOPIC/OtaUrl $EVTPART1\
upgrade:noArg CMNDTOPIC/upgrade 1
attr MQTT2_Gosund_SP112 setStateList on off toggle
define FileLog_MQTT2_Gosund_SP112 FileLog ./log/MQTT2_Gosund_SP112-%Y.log MQTT2_Gosund_SP112
setuuid FileLog_MQTT2_Gosund_SP112 5e3edcb4-f33f-20ab-c8bb-eb3549ac4c9f5545
attr FileLog_MQTT2_Gosund_SP112 logtype text
attr FileLog_MQTT2_Gosund_SP112 room MQTT2_DEVICE
define MQTT2_Gosund_SP112_CH2 MQTT2_DEVICE Gosund_SP112
setuuid MQTT2_Gosund_SP112_CH2 5e3ede04-f33f-20ab-aca0-d61f10fb5f145c53
attr MQTT2_Gosund_SP112_CH2 IODev m2server
attr MQTT2_Gosund_SP112_CH2 comment Channel 2 for MQTT2_Gosund_SP112
attr MQTT2_Gosund_SP112_CH2 devStateIcon on:usb:off off:usb@red:on
attr MQTT2_Gosund_SP112_CH2 icon usb
attr MQTT2_Gosund_SP112_CH2 jsonMap POWER2:0 Dimmer:pct POWER1:0 Heap:0 LedTable:0 LoadAvg:0 MqttCount:0 SaveData:0 Scheme:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0 ANALOG_A0:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0
attr MQTT2_Gosund_SP112_CH2 model tasmota_2channel_split
attr MQTT2_Gosund_SP112_CH2 readingList STATTOPIC/POWER2:.* state\
Gosund_SP112:stat/tasmota/POWER1:.* POWER1\
Gosund_SP112:stat/tasmota/POWER2:.* POWER2\
Gosund_SP112:cmnd/tasmota/POWER:.* POWER
attr MQTT2_Gosund_SP112_CH2 room MQTT2_DEVICE
attr MQTT2_Gosund_SP112_CH2 setList off:noArg CMNDTOPIC/POWER2 0\
on:noArg CMNDTOPIC/POWER2 1\
toggle:noArg CMNDTOPIC/POWER2 2
attr MQTT2_Gosund_SP112_CH2 setStateList on off toggle
hier die reading 1:
Internals:
CID Gosund_SP112
DEF Gosund_SP112
DEVICETOPIC MQTT2_Gosund_SP112
FUUID 5e3edcb4-f33f-20ab-7d89-b1294f58112805ab
IODev m2server
NAME MQTT2_Gosund_SP112
NR 155
STATE set_off
TYPE MQTT2_DEVICE
JSONMAP:
Channel_0 0
Channel_1 0
Channel_2 0
Channel_3 0
Channel_4 0
Color 0
Dimmer 0
HSBColor 0
POWER1 0
POWER2 0
POWER3 0
POWER4 0
READINGS:
2020-02-08 17:13:03 associatedWith MQTT2_Gosund_SP112_CH2
2020-02-08 17:20:10 state set_off
2020-02-08 17:24:27 subscriptions cmnd/Gosund_SP112_fb/# cmnd/tasmota/# cmnd/tasmotas/#
Attributes:
IODev m2server
autocreate 0
comment NOTE: For on-for-timer SetExtensions are used. You may add on-for-timer option running on the device. The following is limited to 1h max duration, but will not affect future simple "on" commands:<br>on-for-timer {my $duration = $EVTPART1*10; 'cmnd/CMNDTOPIC/Backlog POWER1 1; delay '.$duration.'; POWER1 0'}<br>See the "Praxisbeispiele" in the wiki for "pulseTime1" alternative option and it's restrictions.
icon hue_filled_outlet
jsonMap POWER1:0 POWER2:0 POWER3:0 POWER4:0 Dimmer:0 Channel_0:0 Channel_1:0 Channel_2:0 Channel_3:0 Channel_4:0 HSBColor:0 Color:0
model tasmota_basic_state_power1
readingList TELETOPIC/LWT:.* LWT
TELETOPIC/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }
TELETOPIC/SENSOR:.* { json2nameValue($EVENT,'',$JSONMAP) }
TELETOPIC/INFO.:.* { json2nameValue($EVENT,'',$JSONMAP) }
TELETOPIC/UPTIME:.* { json2nameValue($EVENT,'',$JSONMAP) }
TELETOPIC/POWER1:.* state
STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
room MQTT2_DEVICE
setList off:noArg CMNDTOPIC/POWER1 0
on:noArg CMNDTOPIC/POWER1 1
toggle:noArg CMNDTOPIC/POWER1 2
setOtaUrl:textField CMNDTOPIC/OtaUrl $EVTPART1
upgrade:noArg CMNDTOPIC/upgrade 1
setStateList on off toggle
hier das reading 2 vom usb:
Internals:
CID Gosund_SP112
DEF Gosund_SP112
DEVICETOPIC MQTT2_Gosund_SP112_CH2
FUUID 5e3ede04-f33f-20ab-aca0-d61f10fb5f145c53
IODev m2server
LASTInputDev m2server
MSGCNT 2
NAME MQTT2_Gosund_SP112_CH2
NR 159
STATE set_off
TYPE MQTT2_DEVICE
m2server_MSGCNT 2
m2server_TIME 2020-02-08 17:23:29
JSONMAP:
ANALOG_A0 0
Dimmer pct
Heap 0
LedTable 0
LoadAvg 0
MqttCount 0
POWER1 0
POWER2 0
SaveData 0
Scheme 0
SetOption26 0
Sleep 0
SleepMode 0
Speed 0
StateText1 0
StateText2 0
StateText3 0
StateText4 0
Time 0
Uptime 0
UptimeSec 0
Wifi_AP 0
Wifi_BSSId 0
Wifi_Channel 0
Wifi_Downtime 0
Wifi_LinkCount 0
Wifi_RSSI 0
Wifi_SSId 0
READINGS:
2020-02-08 17:23:28 POWER
2020-02-08 17:23:29 POWER1 OFF
2020-02-08 17:17:40 POWER2 OFF
2020-02-08 17:13:03 associatedWith MQTT2_Gosund_SP112
2020-02-08 17:20:09 state set_off
2020-02-08 17:24:27 subscriptions cmnd/Gosund_SP112_fb/# cmnd/tasmota/# cmnd/tasmotas/#
Attributes:
IODev m2server
comment Channel 2 for MQTT2_Gosund_SP112
devStateIcon on:usb:off off:usb@red:on
icon usb
jsonMap POWER2:0 Dimmer:pct POWER1:0 Heap:0 LedTable:0 LoadAvg:0 MqttCount:0 SaveData:0 Scheme:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0 ANALOG_A0:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0
model tasmota_2channel_split
readingList STATTOPIC/POWER2:.* state
Gosund_SP112:stat/tasmota/POWER1:.* POWER1
Gosund_SP112:stat/tasmota/POWER2:.* POWER2
Gosund_SP112:cmnd/tasmota/POWER:.* POWER
room MQTT2_DEVICE
setList off:noArg CMNDTOPIC/POWER2 0
on:noArg CMNDTOPIC/POWER2 1
toggle:noArg CMNDTOPIC/POWER2 2
setStateList on off toggle
Angelegt wurde das ganz mit dem entsprechenden Template:
Plug with additional USB outlet flashed with Tasmota.
For use e.g. with Gosund SP112 or Blitzwolf SH5
NOTE: a second device will be created for the USB channel.
NOTE: still untested template, feedback is welcome!
set DEVICE attrTemplate tasmota_2channel_split
set DEVICE attrTemplate tasmota_POW
attr DEVICE comment Channel 1 for DEVICE, see also DEVICE_CH2
copy DEVICE DEVICE_CH2
attr DEVICE_CH2 icon ICON
attr DEVICE_CH2 comment Channel 2 (USB outlets) for DEVICE
setreading DEVICE_CH2 associatedWith DEVICE
attr DEVICE_CH2 devStateIcon on:usb:off off:usb@red:on
attr DEVICE_CH2 setStateList on off toggle
set DEVICE_CH2 attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE,DEVICE_CH2 model tasmota_POW_USB_split
wobei das Template beim zusammenbau immer wieder sagt der CH2 wäre schon vorhanden und müsste gelöscht werden obwohl ich den vorher nicht angelegt hatte. Evtl ist das noch ein bug im template?
VG
Da ist bei der Auswertung des topic-trees was schief gelaufen bzw. du hast die Rückfrage von attrTemplate nicht zutreffend beantwortet. (Hast du das Device händisch angelegt, oder kam das aus autocreate?)
Hast du weitere tasmota-Devices? Das "tasmota" in dem Topic-tree ist m.E. nicht so gut, nimm lieber die Empfehlung aus dem Wiki oder sonst was mit mehr Unterscheidungskraft.
Kannst du dann nochmal alles löschen, was mit dem Device zu tun hat und autocreate arbeiten lassen, den Zwischenstand (Bitte als RAW-Code!) wegspeichern, dann das attrTemplate anwenden und dann nochmal posten, was am Ende für beide Kanäle rauskam?
Da hast du recht, die Rückfragen habe ich nicht wirklich kapiert. CMDTOPIC TELETOPIC..
Ja per Autocreate
Ja ich habe weitere Devices
Hab alles gelöscht und hier der autocreate:
defmod MQTT2_Gosund_SP112 MQTT2_DEVICE Gosund_SP112
attr MQTT2_Gosund_SP112 IODev m2server
attr MQTT2_Gosund_SP112 readingList Gosund_SP112:cmnd/tasmota/POWER:.* POWER\
Gosund_SP112:stat/tasmota/POWER1:.* POWER1\
Gosund_SP112:stat/tasmota/POWER2:.* POWER2
attr MQTT2_Gosund_SP112 room MQTT2_DEVICE
setstate MQTT2_Gosund_SP112 2020-02-09 09:00:13 POWER
setstate MQTT2_Gosund_SP112 2020-02-09 09:02:53 POWER1 ON
setstate MQTT2_Gosund_SP112 2020-02-09 09:00:56 POWER2 OFF
setstate MQTT2_Gosund_SP112 2020-02-09 09:00:51 subscriptions cmnd/Gosund_SP112_fb/# cmnd/tasmota/# cmnd/tasmotas/#
Und hier nachdem ich das Template angewendet hatte:
define MQTT2_Gosund_SP112 MQTT2_DEVICE Gosund_SP112
setuuid MQTT2_Gosund_SP112 5e3fbead-f33f-20ab-41db-598fbafb4dadf89a
attr MQTT2_Gosund_SP112 IODev m2server
attr MQTT2_Gosund_SP112 autocreate 0
attr MQTT2_Gosund_SP112 comment NOTE: For on-for-timer SetExtensions are used. You may add on-for-timer option running on the device. The following is limited to 1h max duration, but will not affect future simple "on" commands:<br>on-for-timer {my $duration = $EVTPART1*10;; 'cmnd/Gosund_SP112/Backlog POWER1 1;; delay '.$duration.';; POWER1 0'}<br>See the "Praxisbeispiele" in the wiki for "pulseTime1" alternative option and it's restrictions.
attr MQTT2_Gosund_SP112 icon hue_filled_outlet
attr MQTT2_Gosund_SP112 jsonMap POWER1:0 POWER2:0 POWER3:0 POWER4:0 Dimmer:0 Channel_0:0 Channel_1:0 Channel_2:0 Channel_3:0 Channel_4:0 HSBColor:0 Color:0
attr MQTT2_Gosund_SP112 model tasmota_basic_state_power1
attr MQTT2_Gosund_SP112 readingList Gosund_SP112/LWT:.* LWT\
Gosund_SP112/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }\
Gosund_SP112/SENSOR:.* { json2nameValue($EVENT,'',$JSONMAP) }\
Gosund_SP112/INFO.:.* { json2nameValue($EVENT,'',$JSONMAP) }\
Gosund_SP112/UPTIME:.* { json2nameValue($EVENT,'',$JSONMAP) }\
Gosund_SP112/POWER1:.* state\
Gosund_SP112/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
attr MQTT2_Gosund_SP112 room MQTT2_DEVICE
attr MQTT2_Gosund_SP112 setList off:noArg Gosund_SP112/POWER1 0\
on:noArg Gosund_SP112/POWER1 1\
toggle:noArg Gosund_SP112/POWER1 2\
setOtaUrl:textField Gosund_SP112/OtaUrl $EVTPART1\
upgrade:noArg Gosund_SP112/upgrade 1
attr MQTT2_Gosund_SP112 setStateList on off toggle
define FileLog_MQTT2_Gosund_SP112 FileLog ./log/MQTT2_Gosund_SP112-%Y.log MQTT2_Gosund_SP112
setuuid FileLog_MQTT2_Gosund_SP112 5e3fbead-f33f-20ab-ba11-ff29505892b2e041
attr FileLog_MQTT2_Gosund_SP112 logtype text
attr FileLog_MQTT2_Gosund_SP112 room MQTT2_DEVICE
define MQTT2_Gosund_SP112_CH2 MQTT2_DEVICE Gosund_SP112
setuuid MQTT2_Gosund_SP112_CH2 5e3fbf4f-f33f-20ab-f992-7745089dc2d1439b
attr MQTT2_Gosund_SP112_CH2 IODev m2server
attr MQTT2_Gosund_SP112_CH2 comment Channel 2 for MQTT2_Gosund_SP112
attr MQTT2_Gosund_SP112_CH2 devStateIcon on:usb:off off:usb@red:on
attr MQTT2_Gosund_SP112_CH2 icon usb
attr MQTT2_Gosund_SP112_CH2 jsonMap POWER2:0 Dimmer:pct POWER1:0 Heap:0 LedTable:0 LoadAvg:0 MqttCount:0 SaveData:0 Scheme:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0 ANALOG_A0:0 SetOption26:0 Sleep:0 SleepMode:0 Speed:0 StateText1:0 StateText2:0 StateText3:0 StateText4:0 Time:0 Uptime:0 UptimeSec:0 Wifi_SSId:0 Wifi_RSSI:0 Wifi_LinkCount:0 Wifi_Downtime:0 Wifi_Channel:0 Wifi_BSSId:0 Wifi_AP:0
attr MQTT2_Gosund_SP112_CH2 model tasmota_2channel_split
attr MQTT2_Gosund_SP112_CH2 readingList STATTOPIC/POWER2:.* state
attr MQTT2_Gosund_SP112_CH2 room MQTT2_DEVICE
attr MQTT2_Gosund_SP112_CH2 setList off:noArg Gosund_SP112/POWER2 0\
on:noArg Gosund_SP112/POWER2 1\
toggle:noArg Gosund_SP112/POWER2 2
attr MQTT2_Gosund_SP112_CH2 setStateList on off toggle
die Lösung:
wenn man beim Template gefragt wird nach CMDTOPIC TELETOPIC und STATTOPIC
ersetzt man diese mit
cmnd/tasmota
tele/tasmota
stat/tasmota
vielleicht hilfts jemandem