MQTT2-Device Heizkörperventil mit FTUI2 Widget_Thermostat regeln

Begonnen von romakrau, 21 April 2026, 09:06:59

Vorheriges Thema - Nächstes Thema

romakrau

Hallo zusammen,

ich möchte gerne ein Heizungkörperventil, angebunde über z2m, mittels einem FTUI2 Widget steuern.

Internals:
   CFGFN     
   CID        zigbee_0xa4c13895792ad247
   DEF        zigbee_0xa4c13895792ad247
   FUUID      69e57f5e-f33f-e93f-7430-d5e13f897aafa126
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     761
   NAME       Kinderzimmer
   NR         414
   STATE      btnLock
Measured: 21 Battery: batteryPercent %
   TYPE       MQTT2_DEVICE
   eventCount 1101
   myBroker_CONN myBroker_192.168.187.76_40352
   myBroker_MSGCNT 761
   myBroker_TIME 2026-04-21 08:45:45
   periodicCounter 1778
   JSONMAP:
     Battery    batteryPercent
     battery    batteryPercent
     current_heating_setpoint desired-temp
     local_temperature temperature
     system_mode mode
     voltage    batterymV
   OLDREADINGS:
   READINGS:
     2026-04-21 08:44:22   attrTemplateVersion 20251023
     2026-04-21 08:45:45   batteryState    ok
     2026-04-21 08:45:45   battery_low     false
     2026-04-21 08:45:45   child_lock      UNLOCK
     2026-04-21 08:45:45   desired-temp    12
     2026-04-21 08:45:45   frost_protection ON
     2026-04-21 08:45:45   linkquality     156
     2026-04-21 08:45:45   local_temperature_calibration 4
     2026-04-21 08:45:45   mode            off
     2026-04-21 08:45:45   running_state   idle
     2026-04-21 08:45:45   scale_protection ON
     2026-04-21 08:45:45   schedule_friday 06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0
     2026-04-21 08:45:45   schedule_monday 06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0
     2026-04-21 08:45:45   schedule_saturday 06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0
     2026-04-21 08:45:45   schedule_sunday 06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0
     2026-04-21 08:45:45   schedule_thursday 06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0
     2026-04-21 08:45:45   schedule_tuesday 06:00/21.0 08:00/16.0 12:00/21.0 14:00/16.0 18:00/21.0 22:00/16.0
     2026-04-21 08:45:45   schedule_wednesday 06:00/17.0 08:00/17.0 12:00/17.0 14:00/16.0 20:00/16.0 22:00/16.0
     2026-04-21 08:45:45   temperature     21
Attributes:
   comment    For use with weekprofile, additional configuration is needed
   devStateIcon LOCKED:secur_lock:btnLock+UNLOCK UNLOCKED:secur_open:btnLock+LOCK
   devicetopic z2m/0xa4c13895792ad247
   getList    desired-temp:noArg desired-temp $DEVICETOPIC/get {"current_heating_setpoint": ""}
  temperature:noArg temperature $DEVICETOPIC/get {"local_temperature": ""}
  preset:noArg preset $DEVICETOPIC/get {"preset": ""}
   icon       temp_control
   jsonMap    current_heating_setpoint:desired-temp local_temperature:temperature Battery:batteryPercent system_mode:mode battery:batteryPercent voltage:batterymV
   model      zigbee2mqtt_thermostat_with_weekprofile
   periodicCmd temperature:55
   readingList $DEVICETOPIC:.* { my %h; my $temp = $EVENT; $temp =~ s/,?("(holidays|workdays)":.([^]]+))./$h{$2}=$3/ge; $EVENT =~ s/,?("(holidays|workdays)":.([^]]+)).//g; my $h2 = json2nameValue($EVENT,'',$JSONMAP); %h = (%h,%$h2); \%h }
   room       MQTT2_DEVICE
   setList    desired-temp:slider,5.0,0.5,30.0,1 $DEVICETOPIC/set {"current_heating_setpoint": $EVTPART1 }
  btnLock:LOCK,UNLOCK $DEVICETOPIC/set {"child_lock": "$EVTPART1"}
  preset:schedule,manual,boost,complex,comfort,eco $DEVICETOPIC/set {"preset": "$EVTPART1"}
  mode:heat,auto,off $DEVICETOPIC/set {"system_mode": "$EVTPART1"}
  holidays $DEVICETOPIC/set/schedule { "holidays":[$EVTPART1] }
  workdays $DEVICETOPIC/set/schedule { "workdays":[$EVTPART1] }
  week:5+2,6+1,7 $DEVICETOPIC/set $EVTPART1
  weekprofile { FHEM::attrT_z2m_thermostat_Utils::z2t_send_weekprofile($NAME, $EVTPART1, $EVTPART2) }
  x_send_set_payload:textField { my $payload = $EVENT;$payload =~ s/$EVTPART0 //; qq($DEVICETOPIC/set $payload)}
   setStateList on off
   stateFormat btnLock
Measured: temperature Battery: batteryPercent %
   userReadings batteryState:battery_low.* {ReadingsVal($name,'battery_low','false') eq 'false'?'ok':'low'}, batteryVoltage:batterymV.* {ReadingsNum($name,'batterymV',0)/1000}
   userattr   weekprofile
   webCmd     desired-temp
   weekprofile zigbee_0xa4c13895792ad247

Im WEbUI funktioniert dies auch zu meiner Zufriedenheit. Im FTUI2 ergibt sich allerdings das Problem dass beim Klick auf das Widget dieses auf 0 springt, ausserhalb des zulässigen Bereiches. Ich vermute die Ursache in dem Verhalten das bei Aktualisierung des Readings "desired-temp" ein String ("set desired-temp 12") an Stelle des Wertes erscheint. Der Wert "12" wird erst als Rückmeldung von dem Ventil gesetzt. Gibt es eine Möglichkeit dies zu korregieren?

TomLee

Versuchs mal mit ignore in setStateList.

ZitatsetStateList command command ...
This attribute is used to get more detailed feedback when switching devices. I.e. when the command on is contained in the list, state will be first set to set_on, and after the device reports execution, state will be set to on (probably with the help of stateFormat). Commands not in the list will set a reading named after the command, with the word set and the command parameters as its value.

If this attribute is not defined, then a set command will set the state reading to the name of the command.
If this attribute is set to ignore, then a set command will not affect any reading in the device.

Beta-User

Zitat von: TomLee am 21 April 2026, 09:23:59Versuchs mal mit ignore in setStateList.

ZitatsetStateList command command ...
This attribute is used to get more detailed feedback when switching devices. I.e. when the command on is contained in the list, state will be first set to set_on, and after the device reports execution, state will be set to on (probably with the help of stateFormat). Commands not in the list will set a reading named after the command, with the word set and the command parameters as its value.

If this attribute is not defined, then a set command will set the state reading to the name of the command.
If this attribute is set to ignore, then a set command will not affect any reading in the device.

M.E. müsste man das löschen, wie bereits an andere Stelle vorgeschlagen.

Oder eben (besser) ein ReadingNum()-Äquivalent auf der ftui-Seite?
Server: HP-elitedesk@Debian 13, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

romakrau

#3
Das Setzen von dem attr "setStateList ignore" hat geholfen. Es erscheint zumindest der Wert nach dem Aktualsieren vom Ventil per z2m.

Ein .match(/\d+\.?\d*/g) hatte ich schon im Widget versucht. Wieso springtder Wert auf 0 beim anklicken des Widgets?
Der Aufruf der Funktion onChange(v) zeigt das v=NaN;