mqtt2.template: Contributing

Begonnen von Beta-User, 15 Dezember 2018, 11:45:40

Vorheriges Thema - Nächstes Thema

Beta-User

Thx, ist seit eben eingecheckt.
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

dietpe1g

Hallo und erstmal danke für die Templates für MQTT.

Zur meiner HW: Habe eine openDTU(DX-DTU), ein Hoymiles HM-300 und 48V Batterie um 24/7 eine Nulleinspeisung für den Grundbedarf (wenn genug Sonne vorhanden ist) zu ermöglichen.

Der HM-300 ist über die DX-DTU angebunden und im device hm300 "abgebildet":
Internals:
   CID        192.168.178.105
   DEF        192.168.178.105
   FUUID      649c6c9d-f33f-39c2-cb5a-ce7d555d4c3658ee
   IODev      mqtt_client
   LASTInputDev mqtt_client
   MSGCNT     11121
   NAME       hm300
   NR         316
   STATE      133.1
   TYPE       MQTT2_DEVICE
   eventCount 12560
   mqtt_client_MSGCNT 11121
   mqtt_client_TIME 2023-07-03 19:54:38
   READINGS:
     2023-07-03 17:03:02   IODev           mqtt_client
     2023-07-03 19:54:38   battery_current 2.57
     2023-07-03 19:54:38   battery_voltage 54.3
     2023-07-03 19:54:34   change_limit    44
     2023-07-03 19:49:36   increment       1
     2023-07-03 19:54:38   limit_absolute  132.00
     2023-07-03 19:54:38   limit_relative  44.00
     2023-06-30 15:43:43   nominal_power   300
     2023-07-03 19:54:38   state           133.1
     2023-07-03 19:54:38   version         02.00
Attributes:
   autocreate 1
   bridgeRegexp solar/hm300/([^/]+)/ch[0-9]+/.*:.* "solar/hm300_$1"
   icon       inverter
   model      hoymiles_microinverter_hub_bridge
   mqttName   hm300
   mqttRoom   solar
   readingList solar/hm300/112183835921/device/hwversion:.* version
solar/hm300/hm-id/status/limit_relative:.* limit_relative
solar/hm300/hm-id/status/limit_absolute:.* limit_absolute
solar/hm300/hm-id/1/voltage:.* battery_voltage
solar/hm300/hm-id/1/current:.* battery_current
solar/hm300/ac/power:.* state
   room       1_Überwachung

Dank des DTU Templates konnte ich die Readings ermitteln und einbringen. Ich habe allerdings nur die eingebracht, die mir informativ sind.
Das Auslesen funktioniert soweit, top!

Um die Grundlast auf Nulleinspeisung zu bringen, ist es notwendig den HM-300 anzusteuern. Dazu setze ich das Reading  change_limit auf den gewünschten Wert. Irgendwo fand ich, dass die Leistung des WR mit folgendem MQTT Befehl funktioniert:
setList change_limit solar/hm300/hm-id/ctrl/limit_nonpersistent_relative/0:Das hat auch dann tatsächlich geklappt, allerdings nur eine Nacht lang. Am nächsten Tag war es vorbei. Auch der MQTT-Explorer bewirkte hier nichts.

Weitere Recherche ergab dass dieser Befehl funktioniert:
change_limit solar/hm300/hm-id/cmd/limit_nonpersistent_relative/0:allerdings nur im MQTT-Explorer.

Bisher habe ich allerdings die Funktion nicht im hm300 device hinbekommen:
setList change_limit solar/hm300/hm-id/cmd/limit_nonpersistent_relative/0:
Was mache ich hier falsch?



Raspi Pi3 mit FHEM, Homematic Komponenten: Funk-Bewegungsmelder innen:HM-Sec-MDIR-2, Funk-Tür/Fensterkont.: HM-Sec-SCo, Funk-Bew.Melder aussen: HM-Sen-MDIR-O-2, Funk LAN Gateway: HM-LGW-O-TW-W-EU-2, Funk-Schaltaktor 4-fach:HM-LC-Sw4-DR, Panasonic TV, AVM Router 7490 / AVM Powerlines 546

Beta-User

Falscher Thread, du stellst eine Frage....

Bitte den "hoymiles"-Thread nutzen, da lesen ggf. die wenigen openDTU-user mit (ich bin auf ahoy). Generell: die mcu auf dem Inverter startet neu, wenn DC weg war, daher auch " non persistent ". Ggf. müßtest du die Logik dahinter anpassen, damit das Limit mit einer gewissen Regelmäßigkeit neu gesetzt wird.
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

twdotnet

#213
Hallo Zusammen,

für den Shelly Plus i4 mit Tasmota Firmware habe ich ein neues MQTT Template. Als Grundlage hab ich mein Template zum Shelly i3 mit Tasmota genommen, und es um den 4. Kanal erweitert.

Getestet mit Tasmota 13.0.0 und Device Config von https://templates.blakadder.com/shelly_plus_i4.html

# shelly plus i4 4 channel input switches with device configuration
name:tasmota_4channel_input_shelly_i4
filter:TYPE=MQTT2_DEVICE
desc:Shelly i4 device flashed with Tasmota, provides four input only channels. <p>Device will be configured with selectable SwitchMode and optional GPIO Template. <br>Recommended SwitchModes 1=FollowMode (normally open switches> or 2=InvertedFollowMode (normally closed switches) </p><p>Tasmota 9.1+ is required for <a href=https://tasmota.github.io/docs/Buttons-and-Switches/#setoption114>SetOption114</a> to detach switches from relays.<p>NOTE: <br>A second, third and fourth device will be created for the second, third and fourth input with suffixes *_CH2, *_CH3 and *_CH4</p>
order:A_04
par:RADIO_TEMPLATE;Configure device and GPIO;{ undef }
par:RADIO_NO_TEMPLATE;Configure device without GPIO template;{ undef }
par:SWITCHMODE1;SwitchMode for Input 1;{ undef }
par:SWITCHMODE2;SwitchMode for Input 2;{ undef }
par:SWITCHMODE3;SwitchMode for Input 3;{ undef }
par:SWITCHMODE3;SwitchMode for Input 4;{ undef }
par:CMNDTOPIC;Command topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}cmnd$3" : undef }
par:TELETOPIC;info topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}tele$3" : undef }
par:STATTOPIC;ack topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}stat$3" : undef }
par:SETCHANNELINFO;Set this to 0 to not set channelinfo;{ 1 }
par:ICON;ICON as set, defaults to taster;{ AttrVal("DEVICE","icon","taster") }
par:IO_DEV;Currently used IO;{ AttrVal('DEVICE','IODev',InternalVal('DEVICE','IODev',undef)->{NAME}) }
# autoconfigure device
option:{RADIO_NO_TEMPLATE}
set IO_DEV publish CMNDTOPIC/Backlog StateText1 off; StateText2 on; StateText3 toggle; StateText4 hold; SwitchMode1 SWITCHMODE1; SwitchMode2 SWITCHMODE2; SwitchMode3 SWITCHMODE3; SwitchMode4 SWITCHMODE4; SetOption26 1; SetOption114 1; SaveData 1
option:{RADIO_TEMPLATE}
set IO_DEV publish CMNDTOPIC/Backlog StateText1 off; StateText2 on; StateText3 toggle; StateText4 hold; SwitchMode1 SWITCHMODE1; SwitchMode2 SWITCHMODE2; SwitchMode3 SWITCHMODE3; SwitchMode4 SWITCHMODE4; SetOption26 1; SetOption114 1; SaveData 1; template {"NAME":"Shelly Plus i4","GPIO":[0,0,0,0,0,0,0,0,192,0,193,0,0,0,0,0,0,0,0,0,0,0,195,194,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"SwitchMode1 1 | SwitchMode2 1 | SwitchMode3 1 | SwitchMode4 1 | SwitchTopic 0 | SetOption114 1"}; module 0
option:global
# setup main device channel 1
attr DEVICE icon ICON
attr DEVICE jsonMap Switch1_Action:state
attr DEVICE setList \
  off:noArg    STATTOPIC/Switch1 0\
  on:noArg     STATTOPIC/Switch1 1\
  toggle:noArg STATTOPIC/Switch1 2
attr DEVICE readingList \
  TELETOPIC/LWT:.* LWT\
  STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
deletereading -q DEVICE (?!associatedWith|IODev).*
attr DEVICE setStateList on off toggle
attr DEVICE autocreate 0
# channel 2
copy DEVICE DEVICE_CH2
deleteattr DEVICE_CH2 alias
attr DEVICE_CH2 readingList \
  STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
attr DEVICE_CH2 jsonMap Switch2_Action:state
attr DEVICE_CH2 setList \
  off:noArg    STATTOPIC/Switch2 0\
  on:noArg     STATTOPIC/Switch2 1\
  toggle:noArg STATTOPIC/Switch2 2
# channel 3
copy DEVICE_CH2 DEVICE_CH3
deleteattr DEVICE_CH3 alias
attr DEVICE_CH3 jsonMap Switch3_Action:state
attr DEVICE_CH3 setList \
  off:noArg    STATTOPIC/Switch3 0\
  on:noArg     STATTOPIC/Switch3 1\
  toggle:noArg STATTOPIC/Switch3 2
# channel 4
copy DEVICE_CH3 DEVICE_CH4
deleteattr DEVICE_CH4 alias
attr DEVICE_CH4 jsonMap Switch4_Action:state
attr DEVICE_CH4 setList \
  off:noArg    STATTOPIC/Switch4 0\
  on:noArg     STATTOPIC/Switch4 1\
  toggle:noArg STATTOPIC/Switch4 2
# associations
option:{SETCHANNELINFO}
set DEVICE attrTemplate set_associatedWith \CHANNELS=4
attr DEVICE,DEVICE_CH2,DEVICE_CH3,DEVICE_CH4 model tasmota_shelly_i4
setreading DEVICE,DEVICE_CH2,DEVICE_CH3,DEVICE_CH4 attrTemplateVersion 20210729 

Viele Grüße
Oliver

Beta-User

Zitat von: twdotnet am 30 Juli 2023, 00:39:51Hallo Zusammen,

für den Shelly Plus i4 mit Tasmota Firmware habe ich ein neues MQTT Template. Als Grundlage hab ich mein Template zum Shelly i3 mit Tasmota genommen, und es um den 4. Kanal erweitert.
Moin, habe eben eine etwas modifizierte Fassung eingecheckt.
Dabei ist mir aufgefallen, dass da (wie im i3) die setList auf STATTOPIC publisht. Kommt mir komisch (im Sinne von unüblich für Tasmota) vor, mag das jemand bitte bestätigen, dass das so korrekt ist?

Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files