Skip to content

Thermostat Scheduled Times #1

@tdashton

Description

@tdashton

motivation

Add thermostat times, e.g. turn on at 9.00 and off at 12.00 and on again at 15.00 and 19.00.

definition

Beginning of the week is either Sunday or Monday, configurable via a controller configuration variable. This is communicated to the client when it communicates with the controller via the status command so it can set up its interface and calculations appropriately.

We will assume in this definition that Monday is set as the beginning of the week.

time data structure

aka TDS

1 => ['temp' => 17000]
32400 => ['temp' => 17000]

limitations TDS

The client should only allow for full minutes, i.e. setting % 60 must be zero. This must be checked by the controller before accepting the settings.

explanation of TDS

The index is the number of seconds since the beginning of the week, i.e. 1 means Monday morning / night at 00:00:01. In the example above, the value indicates that the command temp should be executed with the value 17000. Similarly, 32400 is 09:00:00 on Monday, and 118800 would represent 09:00:00 on Tuesday.

controller logic

The controller checks at each full minute (i.e. ts_rounded_to_nearest_full_second % 60 == 0) to see if the number of seconds which have passed since the beginning of the week match one of the settings received in the data structure. If yes, then the controller must execute the command which is contained in the TDS. E.g. above at 09:00:00 the temp command would be executed with 17000.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions