ESP Home Documentation
LOGIN

User Data Files

ESP.getUserData

Fetch contents of a user data file.

Syntax:
ESP.getUserData(file_id, callback)

  • file_id is the identifier that you used to create the JavaScript or data file in esphome.app site.
  • callback is the function that will be called when fetch process complete. General form of the callback function is function(isSuccess, data){} where isSuccess is a boolean value indicating that operation was successful and data is the contents of the file.

ESP.setUserData

Fetch contents of a user data file.

Syntax:
ESP.setUserData(file_id, data, callback)

  • file_id is the identifier that you used to create the JavaScript or data file in esphome.app site.
  • data is the content of the file that you would like to save.
  • callback is the function that will be called when fetch process complete. General form of the callback function is function(isSuccess){} where isSuccess is a boolean value indicating that operation was successful.