Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thermostat Schedule Retrieval Code #38

Merged
merged 26 commits into from
Jan 29, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f097057
added first version of thermostat schedule retrieval code
john-b-yang Jan 10, 2019
8b64617
added working draft of schedule retrieval code. Added rrule conversio…
john-b-yang Jan 11, 2019
e595d59
cleaned up JSON struct field and type naming
john-b-yang Jan 11, 2019
f925fc5
debugging unknown variable issue
john-b-yang Jan 11, 2019
05d009b
created polling parameters, code for retrieving thermostat schedule i…
john-b-yang Jan 11, 2019
bd32c96
cleaned up method, struct, and variable naming. Replace id with noden…
john-b-yang Jan 11, 2019
79e33ee
edited thermostat scheduler code by recommendations
john-b-yang Jan 13, 2019
a46e042
removed unnecessary conditional case
john-b-yang Jan 14, 2019
fa4c6df
replaced structs for retrieving thermostat IDs with free form interfa…
john-b-yang Jan 14, 2019
a7ff14d
removed all decoding structs, reimplemented JSON parsing with free fo…
john-b-yang Jan 14, 2019
1e9aebd
reverted free form interface JSON decoding to struct based approach. …
john-b-yang Jan 15, 2019
92149c3
added small modification to interface name
john-b-yang Jan 16, 2019
420aed1
added msgpack aliases to return JSONs
john-b-yang Jan 16, 2019
ec0a841
added descriptions to the thermostat schedule result structs
john-b-yang Jan 16, 2019
7c6e4cc
some refs failed to push, repushing
john-b-yang Jan 16, 2019
686d8e0
adding markdown description of schedule interface, file is interface.md
john-b-yang Jan 18, 2019
91504f9
added more in depth explanations regarding schedule struct in interfa…
john-b-yang Jan 19, 2019
2ae10cd
corrected struct definition errors, added explanation regarding how R…
john-b-yang Jan 21, 2019
7739169
added examples regarding what time conversion might look like
john-b-yang Jan 22, 2019
a242229
corrected grammatical + syntax errors in interface doc
john-b-yang Jan 23, 2019
3d9501a
small grammatical correction
john-b-yang Jan 23, 2019
e93ed19
cut out intermediate day schedule struct and made time parsing more c…
john-b-yang Jan 24, 2019
1643010
added new schedule go request field to Pelican, corrected occupancy s…
john-b-yang Jan 24, 2019
e20fda0
created 3 new fields for Pelican struct (id, cookie, sitename). Recon…
john-b-yang Jan 26, 2019
266e819
added 2 clarifying comments regarding setCookieAndID method
john-b-yang Jan 26, 2019
aad2654
cleaned up syntax + conditional cases. Added new cookie expiration fi…
john-b-yang Jan 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions driver/pelican/interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### Pelican Schedule Interface Outline

##### Context

The following structs define the way users interact with the Scheduling interface of the Pelican thermostats. These structs are used to define the weekly schedule and will be interpretted by the thermSchedule.go code to retrieve/view in addition to making changes to the existing schedule for individual thermostats within a particular site. These structs are public and accessible to anyone who subscribes to the allotted endpoint or publishes to the assigned signal.
john-b-yang marked this conversation as resolved.
Show resolved Hide resolved

##### Schedule Structs

// Struct mapping each day of the week to its daily schedule <br>
john-b-yang marked this conversation as resolved.
Show resolved Hide resolved
type ThermostatSchedule struct {<br>
&nbsp;&nbsp;&nbsp;DaySchedules map[string]ThermostatDaySchedule `msgpack:"day_schedules"`<br>
john-b-yang marked this conversation as resolved.
Show resolved Hide resolved
}<br>

// Struct containing a series of blocks that describes a one day schedule <br>
type ThermostatDaySchedule struct { <br>
&nbsp;&nbsp;&nbsp;Blocks []ThermostatBlockSchedule `msgpack:blocks` <br>
} <br>

// Struct containing data defining the settings of each schedule block <br>
type ThermostatBlockSchedule struct { <br>
&nbsp;&nbsp;&nbsp;CoolSetting float64 `msgpack:"cool_setting"` <br>
john-b-yang marked this conversation as resolved.
Show resolved Hide resolved
&nbsp;&nbsp;&nbsp;HeatSetting float64 `msgpack:"heat_setting"` <br>
&nbsp;&nbsp;&nbsp;System string `msgpack:"system"` <br>
&nbsp;&nbsp;&nbsp;Time string `msgpack:"time"` <br>
}

##### Schedule Structs Explanation

Each Pelican Thermostat has three potential schedule settings.
1. Weekly: Each day of the week (Sun - Sat) has a unique daily schedule setting
2. Daily: Each day of the week has the same daily schedule
3. Weekday/Weekend: Per the name, weekdays and weekends have different schedules.

Next, it's wise if we attempt to define what a "daily schedule" actually looks like. Each day's schedule consist of a series of what we'll call "blocks". Each block details a certain number of settings that are enacted at a certain time of day. This is encapsulated by the ThermostatBlockSchedule struct. For example, one might have a series of four different blocks with time intervals at 6:00 a.m., 11:00 a.m., 4:00 p.m., and 6:00 p.m. At each of these times, the associated cool temperature, heat temperature, and system settings are all enacted.
john-b-yang marked this conversation as resolved.
Show resolved Hide resolved

Going one layer above, the ThermostatDaySchedule struct represents an array of blocks. The purpose of this struct is to represent the schedule of one day a.k.a a series of blocks. Last but not least, the outermost struct, "ThermostatSchedule", maps each day of the week (Sunday - Saturday) to their respective daily schedules (ThermostatDaySchedule struct). This is the struct that is delivered to the user for getting and setting purposes.

##### XBOS Interface Configuration

The current version of XBOS uses YAML files to define the expectations for the output of different functionalities of the driver code from the bw2-contrib repository. There are a couple limitations regarding what the YAML files are able to represent. The incumbent version of XBOS features protobuf definitions for messages. When the next release of XBOS comes, both new and existing YAML files will be created and modified to reflect the outputs' types more accurately.