Heaty will die, Schedy be born!

ok i tried all the combinations so that’s the config. Now in config I have only your link. I attach the logo below, nothing has changed.

There are no combinations to try. And actually, something has changed. Now you use the correct version as Next is now available. :slight_smile:

Still, there’s one thing missing. You need to change the temperature once manually before opening the window for the first time so that Schedy can notice a change. This is only required after you restarted HA (which you seem to have done before generating the log).

Roschi, it works a little differently. The first time it works and all subsequent ones I have to change the temperature manually. In addition, it never returns to its pre-opening state after closing. Below is the log with comments.

https://1drv.ms/t/s!AovBANK6qDEvkUrtA2mxLjqspDIt

Ok, that’s now something to work with. I’ll investigate tonight.

Could you please do this:

  1. Restart HA and AppDaemon
  2. Once it’s both up, change the temperature manually at one of the thermostats
  3. Open a window - thermostats should go off
  4. Close the window again - thermostats should return back fine
  5. Repeat steps 3-4 once more.

No matter if that works as intended or not, could you please take a log of that procedure again?

log in the link, works as you wrote, i.e. after restarting, when I start with the temperature change it works as it should open the window closing the thermostat, window closing restoring the temperature from before opening.

If I start from opening the window, it does not restore settings after closing.

https://1drv.ms/t/s!AovBANK6qDEvkUt6rb6670MHN0GD

interestingly, after restart, I start by opening the window (this scenario does not work) and then I will just restart AppDaemon and start by increasing the temperature it does not work. Only after restarting the whole HA, the scenario in which I start with increasing the temperature works again

The problem is that Schedy stores its state as a HA sensor entity, which doesn’t survive a restart of HA. Your last scenario, in which you restarted HA while window is open thus can’t work because Schedy doesn’t know what to restore after closing the window again.

Ok, we’re now one step further. Still Schedy can’t know what to restore when HA was restarted while window is open, but you should now be able to close it, do a manual adjustment once and then rely on it working correctly again.

EDIT: Tested and works as expected.

@roschi when schedy creates sensors that are important for the working of schedy, then why dont you store the value from it (on change) and restore it at startup from schedy?

@ReneTode Because I want to keep the information at only one central place (in HA) and not invent another custom mechanism to store them somewhere in the file system. Ideally there would be a native way to create custom persistent HA entities.

EDIT: Maybe AppDaemon should provide a native way for persisting app-local data? App developers shouldn’t need to deal with this individually, because eerybody will do it differently :slight_smile:

if i am not mistaken that is optionally available in AD 4.
at least odia is working with something like that.
i havent used it though.

but i see no difference between if I save the values myself (in a file a DB, or any other way) or when AD does the same thing with a function :wink:

if i am not mistaken that is optionally available in AD 4.
at least odia is working with something like that.
i havent used it though.

Cool, if not, I could provide a simple implementation to you.

but i see no difference between if I save the values myself (in a file a DB, or any other way) or when AD does the same thing with a function :wink:

The difference is that over time, 10 people will start to use 10 different storage formats, locations and storing/loading code with 10 different kinds of bugs in them :wink:
Especially thread-safety is one thing to consider thoroughly with AD’s architecture and it’s best if one experienced architect does this properly.

I simply opened an issue to be sure.

indd that’s best solution have it integrated in AD.

but while we wait… why not save the value in an input text entity id, created by schedy like you create the schedy specific sensors.

those 10 different people started to use those 10 different storage formats 3 years ago :wink:
and even if it is possible intern that wont prevent people from doing it their own way.

maybe you like shelve better, then the way AD does it, or you prefer to create your own files.
i myself write sensor data to files for almost 3 years now, and recreate the sensors on startup.
im no achitect, but in 3 years with millions of writes i never got any trouble.
people worry about threadsafety more then they need to :wink:

those 10 different people started to use those 10 different storage formats 3 years ago :wink:
and even if it is possible intern that wont prevent people from doing it their own way.

i myself write sensor data to files for almost 3 years now, and recreate the sensors on startup.
im no achitect, but in 3 years with millions of writes i never got any trouble.
people worry about threadsafety more then they need to :wink:

Never mind, I’m better not going to discuss this with you here.

@elRadix I thought about this as well, but it requires people to add another bit of config to HA to declare that input_text entity. I’m not sure yet, but I’m either going to wait what happens to AppDaemon or really use plain files…

Roschi, can anything else in this topic be done?

I’ll wait for the native persistent storage in AppDaemon 4, everything else would be quite messy imho.

But anyway, as long as you don’t open a window directly after restarting HA without doing a temperature adjustment in between, you should be fine. Isn’t it working that way for you?

ok. That’s how you write. As the beginning of the sequence is not from opening the window, it’s ok