GithubHelp home page GithubHelp logo

Comments (5)

Resinchem avatar Resinchem commented on June 26, 2024

Oops! I did omit the time platform in my ESPHome.yaml code. Try adding this to the ESPHome YAML:

  - platform: homeassistant
    id: esptime
    on_time_sync:
      then:
        - lambda: !lambda |-
            static boolean bootTimestampSet = false;
            if (!bootTimestampSet) {
              bootTimestampSet = true;
              auto now = id(esptime).now();
              now.strftime(buffer, sizeof(buffer), "%Y-%m-%dT%H:%M:%S");
              id(boot_timestamp).publish_state(buffer);
            }

I'm away from home for a few days, but I will verify this is the correct code and update the repository accordingly when I return.

from arylic-amp-mqtt.

ZixZeven avatar ZixZeven commented on June 26, 2024

Thanks for the quick reply and no rush. I am getting error on line: "id(boot_timestamp).publish_state(buffer);" on variable "boot_timestamp" .

from arylic-amp-mqtt.

ZixZeven avatar ZixZeven commented on June 26, 2024

I finally figure out what was missing in the yaml file. I added the following at the end of file.
Thanks for the missing link.

<<<
text_sensor:

  • platform: template
    name: "sirius-tft_esphome Boot Timestamp"
    id: boot_timestamp
    icon: mdi:clock-start

time:

  • platform: homeassistant
    id: esptime
    on_time_sync:
    then:
    - lambda: !lambda |-
    static boolean bootTimestampSet = false;
    if (!bootTimestampSet) {
    bootTimestampSet = true;
    auto now = id(esptime).now();
    now.strftime(buffer, sizeof(buffer), "%Y-%m-%dT%H:%M:%S");
    id(boot_timestamp).publish_state(buffer);
    }

from arylic-amp-mqtt.

Resinchem avatar Resinchem commented on June 26, 2024

Thanks for the update... and again, sorry for the omission on my part. I will correct the repo with the additional code as soon as I return home and am a position to do so.

from arylic-amp-mqtt.

Resinchem avatar Resinchem commented on June 26, 2024

Just a follow up... I've updated the code in the repository to include the missing time: and text_sensor:

from arylic-amp-mqtt.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.