FHEM Forum

FHEM => Frontends => TabletUI => Thema gestartet von: Tobias am 15 November 2025, 15:04:26

Titel: Brauche etwas Starthilfe beim Umstieg auf ftui3
Beitrag von: Tobias am 15 November 2025, 15:04:26
Hi,
seit vielen Jahren benutze ich ftui-V2. Jetzt möchte ich das erste Mal mich an ftui3 probieren, scheitere aber schon am Einfachsten.
Habe mich an den Installationsleitfadens und ein example benutzt. Problem ist, das weder Befehle bei fhem ankommen, noch Readings von fhem angezeigt werden.
Über die Websocketverbindung kommen aber Daten, gebe ich die URL im Browser ein, werden munter Daten heruntergeladen.
Ich habe zwar auch in der index.html das debugging eingeschaltet, es kommen aber keine toast messages so wie ich es von v2 gewohnt war.
Ich bin Ratlos, jemand einen Tipp?

meine index.html
<!DOCTYPE html>
<html>

<head>
  <script src="ftui.js"></script>
  <link href="ftui.css" rel="stylesheet">
  <link href="themes/ftui-theme.css" rel="stylesheet">
  <link href="favicon.ico" rel="icon" type="image/x-icon" />

  <meta name="debug" content="1">
  <meta name="toast_position" content="top">

  <title>FTUI Example Label</title>
</head>

<body>

  <ftui-grid base-width="120" base-height="120" shape="round" margin="6">

    <ftui-grid-tile row="1" col="1" height="2" width="2">
      <ftui-grid-header>TEST IT</ftui-grid-header>
      <div class="cell">
        <ftui-button [(value)]="SW_Licht_EG_WZEZ:LichtEZ" states="on,off">Press here</ftui-button>
      </div>
    </ftui-grid-tile>

    <ftui-grid-tile row="1" col="3" height="2" width="2">
      <ftui-grid-header>Align</ftui-grid-header>
      <ftui-row>
        <ftui-column>Lamp1</ftui-column>
        <ftui-column [color]="SW_Licht_EG_WZEZ:LichtEZ | map('on:danger, off:success')">
          <ftui-label [text]="SW_Licht_EG_WZEZ:LichtEZ"></ftui-label>
        </ftui-column>
      </ftui-row>
    </ftui-grid-tile>
   

  </ftui-grid>
</body>

</html>

HIer das Reading was ich anzeigen möchte:
Internals:
   .FhemMetaInternals 1
   FUUID      5c7ea0e9-f33f-99a0-8603-fa0f4be8f1acc81c
   FVERSION   10_MQTT_DEVICE.pm:0.249520/2021-09-11
   IODev      mqtt
   NAME       SW_Licht_EG_WZEZ
   NR         234
   STATE      on
   TYPE       MQTT_DEVICE
   eventCount 84
   .attraggr:
   .attrminint:
   .qos:
     *          0
   .retain:
     *          0
   .userReadings:
     HASH(0x55749c2277d0)
   READINGS:
     2025-11-15 14:52:34   IODev           mqtt
     2023-01-28 16:02:39   Licht           off
     2025-11-15 14:58:51   LichtEZ         on
     2025-11-15 14:58:31   LichtWZ         off
     2025-11-15 14:58:49   LichtWZ2        off
     2025-11-15 14:58:51   status          on
     2025-11-15 14:58:51   transmission-state incoming publish received
   message_ids:
   publishSets:
     LichtWZ:
       topic      shellies/shelly1-2C7258/relay/0/command
       values:
         on,off
     LichtWZ1:
       topic      shellies/shelly1-2C7258/relay/0/command
       values:
     LichtWZ2:
       topic      shellies/shelly1-2C6BB5/relay/0/command
       values:
         on,off
   sets:
     LichtWZ    on,off
     LichtWZ1  
     LichtWZ2   on,off
   subscribe:
     shellies/shelly1-2C7252/relay/0
     shellies/shelly1-2C7258/relay/0
     shellies/shelly1-2C6BB5/relay/0
   subscribeExpr:
     ^shellies\/shelly1-2C7252\/relay\/0$
     ^shellies\/shelly1-2C7258\/relay\/0$
     ^shellies\/shelly1-2C6BB5\/relay\/0$
   subscribeQos:
     shellies/shelly1-2C6BB5/relay/0 0
     shellies/shelly1-2C7252/relay/0 0
     shellies/shelly1-2C7258/relay/0 0
   subscribeReadings:
     shellies/shelly1-2C6BB5/relay/0:
       cmd       
       name       LichtWZ2
     shellies/shelly1-2C7252/relay/0:
       cmd       
       name       LichtEZ
     shellies/shelly1-2C7258/relay/0:
       cmd       
       name       LichtWZ
Attributes:
   DbLogExclude .*
   IODev      mqtt
   publishSet_LichtWZ on,off shellies/shelly1-2C7258/relay/0/command
   publishSet_LichtWZ1 shellies/shelly1-2C7258/relay/0/command
   publishSet_LichtWZ2 on,off shellies/shelly1-2C6BB5/relay/0/command
   room       MQTT
   stateFormat status
   subscribeReading_LichtEZ shellies/shelly1-2C7252/relay/0
   subscribeReading_LichtWZ shellies/shelly1-2C7258/relay/0
   subscribeReading_LichtWZ2 shellies/shelly1-2C6BB5/relay/0
   userReadings status {(ReadingsVal("$name","LichtWZ","") eq "on" || ReadingsVal("$name","LichtEZ","") eq "on")?"on":"off"}

Titel: Aw: Brauche etwas Starthilfe beim Umstieg auf ftui3
Beitrag von: satprofi am 15 November 2025, 21:18:25
hier ein , bei mir, funktionierendes

<ftui-grid-tile row="5" col="10" height="2" width="2" color="white">
<ftui-label text="Rosenbogen" size="1" bold></ftui-label>
   <ftui-button [(value)]="MQTT2_DVES_064A05" width="75%" height="70%" direction="vertical"
      color="grid"
      [color]="MQTT2_DVES_064A05:POWER | map('on: primary, off: grid')">
        <ftui-icon [name]="MQTT2_DVES_064A05:POWER | map('on: lightbulb-on, off: lightbulb')" size="3"></ftui-icon>
        <ftui-label>Rosenbogen</ftui-label>
      </ftui-button>

</ftui-grid-tile>
Titel: Aw: Brauche etwas Starthilfe beim Umstieg auf ftui3
Beitrag von: Tobias am 19 November 2025, 15:15:08
Hi,
ich habe den Fehler gefunden. Ich greife auf FHEM und FTUI über einen davorgeschalteten Apache mit Auth zu. Die dort gesetzten Outputfilter haben zwar mit FTUI-v2 funktioniert, aber nicht mehr mit FTUI-v3.
Ohne diese Filter funktioniert die Hintergrundkommunikation sofort :)

Für alle Nachahmer hier die komplette config:

<IfModule mod_proxy.c>
  <Location /fhem>

# diese filter zerstoeren die ftui3 kommunikation
#    SetOutputFilter INFLATE;proxy-html;DEFLATE
#    ProxyHTMLEnable On

    # Fuer Logpoll = Websocket die Aufrufe umleiten
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /fhem(.*)           ws://fhem:8083/fhem$1 [P,L]

    # Standard Proxy (OHNE HTML-Filter)
    ProxyPreserveHost On
    ProxyPass http://fhem:8083/fhem
    ProxyPassReverse http://fhem:8083/fhem

    AuthType Basic
    AuthName "Password Required"
    AuthUserFile /run/secrets/sec_apache_htpasswd
    Require valid-user
    Order deny,allow
    Allow from all

  </Location>
</IfModule>

Dockerfile:
FROM debian:bookworm-slim

# Debian Version Abhängigkeit von Roundcubemail (Docker iredmail) und genutzter PHP Version

ENV LANG="de_DE.UTF-8"
ENV DEBIAN_FRONTEND noninteractive

ARG SERVERNAME=localhost

# let's copy a few of the settings from /etc/init.d/apache2
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_PID_FILE $APACHE_RUN_DIR/apache2.pid
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_LOG_DIR /var/log/apache2

COPY conf/phpmyadmin.config.add /tmp/phpmyadmin.config.add

RUN apt-get update -y \
 && apt-get install -y apache2 curl vim nano php libapache2-mod-php php-mbstring cron anacron \
                       wget php-cgi php-mysqli php-pear php-common php-phpseclib php-mysql \
 && apt-get upgrade -y \
 && apt-get clean \
 && wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz \
 && tar xvf phpMyAdmin-latest-all-languages.tar.gz \
 && mv phpMyAdmin-*-all-languages/ /var/www/phpmyadmin \
 && mkdir -p /var/www/phpmyadmin/tmp \
 && mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR \
 && cp /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php \
 && KEY=$(openssl rand -base64 32) \
 && sed -i "s#^\$cfg\['blowfish_secret'\].*#\$cfg['blowfish_secret'] = '$KEY';#g" /var/www/phpmyadmin/config.inc.php \
 && cat /tmp/phpmyadmin.config.add >> /var/www/phpmyadmin/config.inc.php \
 && mkdir -p /var/www/phpmyadmin/tmp \
 && find "$APACHE_CONFDIR" -type f -exec sed -ri ' \
    s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
    s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; ' '{}' ';' \
 && echo "ServerName $SERVERNAME" >> /etc/apache2/apache2.conf \
 && mkdir -p /etc/apache2/ssl \
 && FILE=`mktemp` ; openssl dhparam -out $FILE 2048 && mv -f $FILE /etc/apache2/ssl/dh2048.pem \
 && chown -R www-data:www-data /var/log/apache2/ /etc/apache2/ /var/run/apache2/ /var/www \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


COPY conf/sites-available/*.conf /etc/apache2/sites-available/
COPY conf/cron.weekly/my_dhparams /etc/cron.weekly/
COPY html/* /var/www/html/

RUN a2dissite '*' \
 && a2ensite 00-default 00-ssl 10-fhem 015-fhem-dashboards 40-phpmyadmin \
 && a2enmod ssl headers rewrite proxy proxy_http proxy_html proxy_wstunnel

USER www-data:dialout

EXPOSE 80 443

CMD apache2 -DFOREGROUND