Currently developing: Smart thermostat implementation

Don’t know if this is the right topic for this, correct me if I am wrong.
So… I wanted to learn some data analysis and I started to google about. There is a lot of python data science course, but with that I only learn some out of the book example. I wanted to learn by practical way, so I found this:

I decided to implement in the home assistant in the following way:

  • changing the arduino with an esp with tasmota firmware. This component doesn’t have to have the logic to use the scenarios

  • the Pi part has to be a custom component in the home assistant for logging data, and control the esp in the correct way

  • the cloud component is requesting the data from the home assistant through the REST API, and push back the scenarios through services

Now I need some help how to implement the custom component. I need to save the datas somewhere, but I don’t know exactly how. As I understood the scenarios has to be a class, with some attributes, and save these scenarios as a list? in order to query it later for the component, and for the REST API too. How can I do that? I found this - store the states - way, but I am not sure if it will work: Save and restore state of lights.

I have asked this question also on reddit:

Can somebody help me?