Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Off Topic
    4. Microcontroller
    5. ESPHome: Verständnisfrage Datenpunkte Aktualisieren

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    ESPHome: Verständnisfrage Datenpunkte Aktualisieren

    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      WolfgangFB last edited by

      Ich möchte, dass mein ESP32 alle 10 Sekunden die aktuelle Zeit im Klartext und als Unix Zeit ausgibt. Folgenden Code habe ich hierzu geschrieben:

      
      time:
        - platform: sntp
          timezone: Europe/Berlin
          id: MySntp
          on_time:
            - seconds: /10
              then:
                - lambda: |-
                    // Aktuelle Zeit im Klartext
                    auto now = id(MySntp).now();  // Erzeuge eine Kopie der aktuellen Zeit              
                    id(Zeit) = now.strftime("%d.%m %H:%M:%S");
                    id(ZeitTimestamp) = now.timestamp;
                    id(Aktuellezeit)->publish_state(id(Zeit).c_str());
      
                    // Hole die aktuelle Zeit und aktualisiere den Unix-Timestamp
                    
                    id(AktuellezeitTimestamp)->publish_state(id(ZeitTimestamp));
      

      Komischerweise wird die Zeit im Klartext alle 10 Sekunden richtig ausgegeben, die Unix Zeit aber nicht (irgendwann wird sie aktualisiert, ein Schema konnte ich nicht feststellen).

      Hier iste die Ausgabe:

      16:01:00][D][text_sensor:064]: '116 Zeit': Sending state '19.01 16:01:00'
      [16:01:00][D][sensor:094]: '116 Timestamp': Sending state 1737298816.00000  with 0 decimals of accuracy
      [16:01:01][D][sensor:094]: '116 Laufzeit': Sending state 636.67200 s with 0 decimals of accuracy
      [16:01:06][D][text_sensor:064]: '116 IP': Sending state '192.168.1.70'
      [16:01:10][D][text_sensor:064]: '116 Zeit': Sending state '19.01 16:01:10'
      [16:01:10][D][sensor:094]: '116 Timestamp': Sending state 1737298816.00000  with 0 decimals of accuracy
      [16:01:19][D][sensor:094]: '116 Signal': Sending state -43.00000 dBm with 0 decimals of accuracy
      [16:01:20][D][text_sensor:064]: '116 Zeit': Sending state '19.01 16:01:20'
      [16:01:20][D][sensor:094]: '116 Timestamp': Sending state 1737298944.00000  with 0 decimals of accuracy
      [16:01:23][D][text_sensor:064]: '116 MAC': Sending state '84:F7:03:EA:EF:E0'
      [16:01:30][D][text_sensor:064]: '116 Zeit': Sending state '19.01 16:01:30'
      [16:01:30][D][sensor:094]: '116 Timestamp': Sending state 1737298944.00000  with 0 decimals of accuracy
      [16:01:40][D][text_sensor:064]: '116 Zeit': Sending state '19.01 16:01:40'
      [16:01:40][D][sensor:094]: '116 Timestamp': Sending state 1737298944.00000  with 0 decimals of accuracy
      

      Kann mir jemand erklären was hier schief läuft?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate

      483
      Online

      31.9k
      Users

      80.2k
      Topics

      1.3m
      Posts

      1
      1
      92
      Loading More Posts
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
      The ioBroker Community 2014-2023
      logo