FHEM Forum

FHEM => Frontends => TabletUI => Thema gestartet von: grossmaggul am 30 März 2026, 03:10:09

Titel: map Problem
Beitrag von: grossmaggul am 30 März 2026, 03:10:09
Hallo,

ich habe mir für picframe Pi3d ein MQTT Device gebastelt

Internals:
   .FhemMetaInternals 1
   CID        picframe
   DEF        picframe
   FUUID      6990be2f-f33f-f310-5720-d6d976d6f8420d7b
   FVERSION   10_MQTT2_DEVICE.pm:0.305090/2025-11-09
   IODev      mqtt2_server
   LASTInputDev mqtt2_server
   MSGCNT     5932
   NAME       picframe
   NR         812
   STATE      OFF
   TYPE       MQTT2_DEVICE
   eventCount 5938
   mqtt2_server_CONN mqtt2_server_192.168.1.233_45025
   mqtt2_server_MSGCNT 5932
   mqtt2_server_TIME 2026-03-30 02:44:06
   .DT:
     DEVICETOPIC picframe
   .attraggr:
   .attrminint:
   READINGS:
     2026-03-30 02:44:05   EXIF_DateTimeOriginal 1774644066.0
     2026-03-30 02:43:40   EXIF_ExposureTime 1/250
     2026-03-30 02:44:05   EXIF_FNumber    0.0
     2026-03-30 02:43:40   EXIF_FocalLength 20.0
     2026-03-30 02:44:05   EXIF_ISOSpeedRatings 0.0
     2026-03-29 17:19:13   IODev           mqtt2_server
     2026-03-30 02:44:05   Image_Make      Joint Photographic Experts Group
     2026-03-30 02:44:05   Image_Model     Jpeg File
     2026-03-30 02:44:06   available       online
     2026-03-30 02:44:06   avty_t          homeassistant/switch/picframe/available
     2026-03-30 02:44:06   brightness      1.0
     2026-03-30 02:44:06   command_topic   picframe/directory
     2026-03-30 02:44:06   date_from       -2147389200
     2026-03-30 02:44:06   date_to         2145913200
     2026-03-30 02:44:06   dev_ids_1       picframe
     2026-03-30 02:44:06   dev_mdl         PictureFrame
     2026-03-30 02:44:06   dev_mf          pi3d PictureFrame project
     2026-03-30 02:44:06   dev_name        picframe
     2026-03-30 02:44:06   dev_sw          2025.06.18
     2026-03-30 02:44:06   directory       bilder
     2026-03-30 02:44:06   display         ON
     2026-03-29 17:12:44   displayState    Error evaluating picframe userReading displayState: Can't call method "pausedState" without a package or object reference at (eval 1322619) line 3.\n
     2026-03-30 02:44:06   entity_category config
     2026-03-30 02:44:06   fade_time       15.0
     2026-03-30 02:44:06   icon            mdi:folder-multiple-image
     2026-03-30 02:44:06   image           2025-04-04 17.20.22.jpg
     2026-03-30 02:44:06   image_counter   1294
     2026-03-29 23:37:14   json_attributes_topic homeassistant/sensor/picframe_image/attributes
     2026-03-30 02:42:00   latitude        57.8627
     2026-03-30 02:42:00   location        Wilkhaven, Highland, Scotland, United Kingdom
     2026-03-30 02:44:06   location_filter
     2026-03-30 02:42:00   longitude       -3.7795
     2026-03-30 02:44:06   matting_images  1
     2026-03-29 23:37:14   max             1.0
     2026-03-29 23:37:14   min             0.0
     2026-03-30 02:44:06   name            directory
     2026-03-30 02:44:06   options_1       1983
     2026-03-30 02:44:06   options_10      2010
     2026-03-30 02:44:06   options_11      2011
     2026-03-30 02:44:06   options_12      2012
     2026-03-30 02:44:06   options_13      2013
     2026-03-30 02:44:06   options_14      2014
     2026-03-30 02:44:06   options_15      2015
     2026-03-30 02:44:06   options_16      2016
     2026-03-30 02:44:06   options_17      2017
     2026-03-30 02:44:06   options_18      2018
     2026-03-30 02:44:06   options_19      2019
     2026-03-30 02:44:06   options_2       1997
     2026-03-30 02:44:06   options_20      2020
     2026-03-30 02:44:06   options_21      2021
     2026-03-30 02:44:06   options_22      2022
     2026-03-30 02:44:06   options_23      2023
     2026-03-30 02:44:06   options_24      2024
     2026-03-30 02:44:06   options_25      2025
     2026-03-30 02:44:06   options_26      2026
     2026-03-30 02:44:06   options_27      bilder
     2026-03-30 02:44:06   options_3       1999
     2026-03-30 02:44:06   options_4       2004
     2026-03-30 02:44:06   options_5       2005
     2026-03-30 02:44:06   options_6       2006
     2026-03-30 02:44:06   options_7       2007
     2026-03-30 02:44:06   options_8       2008
     2026-03-30 02:44:06   options_9       2009
     2026-03-30 02:44:06   paused          OFF
     2026-03-29 23:37:15   payload_press   ON
     2026-03-30 02:44:06   shuffle         ON
     2026-03-29 23:37:15   state           OFF
     2026-03-30 02:44:06   state_topic     homeassistant/sensor/picframe/state
     2026-03-29 23:37:14   step            0.01
     2026-02-14 19:25:51   subscriptions   homeassistant/button/picframe_back/set homeassistant/button/picframe_delete/set homeassistant/button/picframe_next/set homeassistant/switch/picframe_caption_toggle/set homeassistant/switch/picframe_clock/set homeassistant/switch/picframe_date_toggle/set homeassistant/switch/picframe_directory_toggle/set homeassistant/switch/picframe_display/set homeassistant/switch/picframe_location_toggle/set homeassistant/switch/picframe_name_toggle/set homeassistant/switch/picframe_paused/set homeassistant/switch/picframe_shuffle/set homeassistant/switch/picframe_text_off/set homeassistant/switch/picframe_text_refresh/set homeassistant/switch/picframe_title_toggle/set picframe/brightness picframe/date_from picframe/date_to picframe/directory picframe/fade_time picframe/image picframe/image_counter picframe/location_filter picframe/matting_images picframe/purge_files picframe/stop picframe/tags_filter picframe/time_delay
     2026-03-30 02:44:06   tags_filter     
     2026-03-30 02:44:06   time_delay      25.0
     2026-03-30 02:44:06   uniq_id         picframe_directory
     2026-03-30 02:44:06   value_template  {{ value_json.directory}}
Attributes:
   DbLogExclude .*
   IODev      mqtt2_server
   icon       file_image
   readingList picframe:homeassistant/sensor/picframe_image/attributes:.* { json2nameValue($EVENT) }
picframe:homeassistant/sensor/picframe_image/state:.* { json2nameValue($EVENT) }
picframe:homeassistant/select/picframe_directory/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/sensor/picframe/state:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_display/state:.* display
picframe:homeassistant/switch/picframe_shuffle/state:.* shuffle
picframe:homeassistant/switch/picframe_paused/state:.* paused
picframe:homeassistant/switch/picframe/available:.* available
picframe:homeassistant/text/picframe_date_from/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/text/picframe_date_to/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/text/picframe_location_filter/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/text/picframe_tags_filter/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/sensor/picframe_image_counter/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/sensor/picframe_image/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/number/picframe_brightness/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/number/picframe_time_delay/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/number/picframe_fade_time/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/number/picframe_matting_images/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_text_refresh/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_text_refresh/state:.* state
picframe:homeassistant/switch/picframe_name_toggle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_name_toggle/state:.* state
picframe:homeassistant/switch/picframe_title_toggle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_title_toggle/state:.* state
picframe:homeassistant/switch/picframe_caption_toggle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_caption_toggle/state:.* state
picframe:homeassistant/switch/picframe_date_toggle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_date_toggle/state:.* state
picframe:homeassistant/switch/picframe_location_toggle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_location_toggle/state:.* state
picframe:homeassistant/switch/picframe_directory_toggle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_directory_toggle/state:.* state
picframe:homeassistant/switch/picframe_text_off/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_text_off/state:.* state
picframe:homeassistant/switch/picframe_display/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_clock/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_clock/state:.* state
picframe:homeassistant/switch/picframe_shuffle/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/switch/picframe_paused/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/button/picframe_delete/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/button/picframe_back/config:.* { json2nameValue($EVENT) }
picframe:homeassistant/button/picframe_next/config:.* { json2nameValue($EVENT) }
   room       Geräte->Systeme->MQTT2
   setList    brightness:textField picframe/brightness $EVTPART1
timeDelay:textField picframe/time_delay $EVTPART1
fadeTime:textField picframe/fade_time $EVTPART1
matting:textField picframe/matting_images $EVTPART1
directory:textField picframe/directory $EVTPART1
dateFrom:textField homeassistant/text/picframe_date_from/cmd $EVTPART1
dateTo:textField homeassistant/text/picframe_date_to/cmd $EVTPART1
locationFilter:textField homeassistant/text/picframe_location_filter/cmd $EVTPART1
tagsFilter:textField homeassistant/text/picframe_tags_filter/cmd $EVTPART1
display:on,off { fhem("set mqtt2_server publish homeassistant/switch/picframe_display/set ".uc($EVTPART1)) }
paused:on,off { fhem("set mqtt2_server publish homeassistant/switch/picframe_paused/set ".uc($EVTPART1)) }
shuffle:on,off { fhem("set mqtt2_server publish homeassistant/switch/picframe_shuffle/set ".uc($EVTPART1)) }

Nun habe ich mir für FTUI3 Switches für paused, display und shuffle gebaut:
<ftui-switch [(value)]="picframe:display | map('ON:on,OFF:off')" ></ftui-switch>

weil z.B. display ON/OFF liefert, der switch aber auf on/off reagiert.
Ich bekomme aber eine Fehlermeldung, wenn ich den Switch betätige:
set map(ON on,OFF:off) undefined
Der switch ist gestrichelt rot umrandet, wenn ich ihn betätige.

Was übersehe ich?

gm
Titel: Aw: map Problem
Beitrag von: yersinia am 30 März 2026, 08:15:55
Zitat von: grossmaggul am 30 März 2026, 03:10:09Der switch ist gestrichelt rot umrandet
Dann stimmt bereits im FTUI3 schon was nicht.

Zitat von: grossmaggul am 30 März 2026, 03:10:09<ftui-switch [(value)]="picframe:display | map('ON:on,OFF:off')" ></ftui-switch>
Müsste das nicht eher
<ftui-switch [(value)]="picframe:display | map('´ON´:on,´OFF´:off')" ></ftui-switch>sein?