Two small tools for websites about saunas, sauna building, spas and wellness, as CMS components:
- Sauna Heater Calculator (
saunaHeaterCalculator): works out the heater size for a sauna room from its inside size, the glass and stone surfaces, and bare log walls. Shows the room volume, the calculated volume and, for an electric heater, a kW range. For a wood-burning stove it shows the volume to shop by. - Sauna Temperature Converter (
saunaTemperatureConverter): converts sauna thermometer readings between °F and °C, with a table of common readings.
Both forms are sent with GET and worked out in PHP, so they need no JavaScript and every result has its own URL that can be bookmarked or shared. No cookies, no external requests, no database tables. Texts in English and German.
Made by DIVELUX, a small family brand from Irvine, California, that makes wool felt sauna hats. MIT license.
- October CMS 3.x or 4.x
- PHP 8.0 or newer
From the Marketplace: add Sauna Tools to your project, or run
php artisan plugin:install Divelux.SaunaTools
With Composer: composer require divelux/saunatools-plugin, then php artisan october:migrate.
Manually: copy the repository to plugins/divelux/saunatools and run php artisan october:migrate.
Add the components to a page in the CMS editor, or in the page file:
url = "/sauna-tools"
layout = "default"
title = "Sauna tools"
[saunaHeaterCalculator]
unit = "ft"
[saunaTemperatureConverter]
==
<h2>Sauna heater size</h2>
{% component 'saunaHeaterCalculator' %}
<h2>Sauna temperature in °F and °C</h2>
{% component 'saunaTemperatureConverter' %}
The visitor enters the inside size of the hot room (feet and inches, or meters), the area of glass and of stone, tile, brick or concrete with no insulation behind it, ticks a box for bare log walls and picks an electric or a wood-burning heater.
How the size is worked out, using the heater makers' own published sizing rules:
- Room volume: length × width × ceiling height.
- Each square meter of uninsulated glass or stone counts as 1.2 m³ of extra volume (Harvia). HUUM's 1.0 m³ and the 1.5 m³ of a North American HUUM sheet are shown in a table next to it.
- Bare log walls: the room volume is multiplied by 1.5 (Harvia).
- Power: 1 kW per cubic meter of calculated volume (Harvia and HUUM) is the top of the range; 1 kW per 50 cu ft, which matches Harvia's own worked example, is the bottom.
- Wood-burning stoves are sold by room volume, so for a wood stove the result is the calculated volume alone.
The result always comes with a note to confirm the size with the heater manufacturer and a licensed electrician. The tool covers rooms from 3 ft to 19 ft 8 in (0.9 to 6 m) a side and ceilings from 5 ft 7 in to 9 ft 10 in (1.7 to 3 m); values outside that are marked as errors next to the field.
| Property | Default | Description |
|---|---|---|
language |
auto |
auto, en or de. Auto follows the application locale: German for any de locale, English otherwise. |
unit |
ft |
Units the form opens with: ft (feet and inches) or m (meters). Visitors can switch. |
heater |
electric |
Heater the form opens with: electric or wood. |
showRules |
true |
Show the table that compares the Harvia and HUUM rules for the same room. |
showMethod |
true |
Show a collapsed list with the six steps of the calculation. |
loadCss |
true |
Add the plugin stylesheet to the page. Turn off to style the markup yourself. |
credit |
false |
Show a small "Sauna Tools by DIVELUX" link under the tool. |
The component does not inject page variables. Its partial reads __SELF__.view, an array built by Divelux\SaunaTools\Classes\HeaterView::build(): the form values, the error messages and, when the input is valid, result with kicker, headline, sub, stats, notes, use, rules, rulesNote and raw (the unformatted numbers of Heater::calc()).
Converts with °C = (°F − 32) × 5 ÷ 9 and °F = °C × 9 ÷ 5 + 32, rounded to one decimal, for values from -60 to 300. Below the form, a table of 15 common sauna thermometer readings from 140 °F (60 °C) to 212 °F (100 °C).
| Property | Default | Description |
|---|---|---|
language |
auto |
auto, en or de, as above. |
from |
f |
Direction the form opens with: f (°F to °C) or c (°C to °F). |
showTable |
true |
Show the table of common readings. |
loadCss |
true |
Add the plugin stylesheet to the page. |
credit |
false |
Show a small "Sauna Tools by DIVELUX" link under the tool. |
The partial reads __SELF__.view, built by Divelux\SaunaTools\Classes\TemperatureView::build().
The component alias is the HTML id of the tool and the name of its GET parameters, so two calculators on one page keep separate results. Sending one form keeps the other form's query parameters.
[saunaHeaterCalculator heaterFeet]
unit = "ft"
[saunaHeaterCalculator heaterMeters]
unit = "m"
heater = "wood"
- Look: every rule in
assets/css/saunatools.cssis scoped to.st. Change the colors with the custom properties--st-ink,--st-muted,--st-line,--st-surface,--st-accent,--st-accent-ink,--st-errorand--st-radius, or setloadCssto false and write your own styles. - Markup: override a partial in your theme, as with any component: copy the plugin's
components/heatercalculator/default.htmtopartials/<alias>/default.htmin the theme (for examplepartials/saunaHeaterCalculator/default.htm) and edit it. - Words: change any visitor-facing string with
\Divelux\SaunaTools\Classes\Text::set('en', 'submit', 'Size my heater'), for example in theboot()method of your own plugin. The keys are inclasses/Text.php. - In PHP:
\Divelux\SaunaTools\Classes\Heater::calc(['length' => 2.5, 'width' => 2, 'height' => 2, 'glass' => 1.6])returns the full result array (lengths in meters, areas in square meters).
The sizing code is a line-by-line PHP port of the JavaScript calculator on the DIVELUX website. tests/run.sh (needs node, and PHP or Docker) compares the port with the JavaScript original on about 72,700 cases, every field exact, then checks the view models of both components. The plugin was also checked in the official October CMS Docker image (v4.4, PHP 8.4): installation, both components in English and German, error states, two tools on one page and escaping of typed input.
The code was written with the help of an AI coding assistant and checked by the tests above.
MIT. See LICENSE.