ESP Home Documentation
LOGIN

General Functions

ESP.include

Use this function to include other JavaScripts into your main JS file.

Syntax:
ESP.include("js_identifier")

  • js_identifier is the identifier that you used to create the JavaScript file in esphome.app site.

ESP.unixTimeStamp

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

Syntax:
ESP.unixTimeStamp()

ESP.log

Adds a message to logs.

Syntax:
ESP.log(message)

  • message is the message that will be added to log.

Logs can be seen on the app. For compatibility you can also use console.log(message) with same effect.

ESP.html2text

Converts HTML to TEXT.

Syntax:
ESP.html2text(htmlString)

  • htmlString is the html that you want to convert into text.