Learn X-300 scripting
Each lesson adds one idea. Lessons 1–4 build one script up step by step; lessons 5–7 start again from the plain thermostat so each new idea stands alone, and the case study shows them all combined. Every lesson's script is a real file that this site's test suite runs, so what a page says the script does is what the simulator does.
- A time schedule: the loop every script lives in,
time, and turning a relay on and off. - A thermostat: reading a sensor, a setpoint and a swing, and why a thermostat needs two thresholds.
- Day and night: choosing a setpoint by time of day.
- Weekdays: working out the day of the week from
date. - Timers: keeping the heat off for at least five minutes once it goes off.
- Data from outside: letting another device push the outside temperature in, and not trusting it once it goes quiet.
- Seasons: the day of the year from
date, and an override switch on the control page.
Before you start
- What the unit is. The X-300 is a network temperature controller with three relays and inputs for up to eight temperature sensors. You set it up through its own web pages; a script runs on the unit itself.
- Where scripts go. On the unit's setup pages there is a Script tab where you upload a text file and tell it to run. The manual's BASIC appendix (Appendix G of the X-300 users manual) is the official description of the language.
- How to read the lessons. Each one shows the whole script, explains what each part does, and ends with something to try in the playground.
The reference lists every statement and variable in one place, and Rules & checklist collects the limits.