Skip to content

About

Sauna heater size calculator and °F/°C converter components for October CMS 3.x/4.x. No JavaScript, MIT.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Sauna Tools for October CMS

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.

Requirements

  • October CMS 3.x or 4.x
  • PHP 8.0 or newer

Installation

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.

Quick start

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 heater calculator

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:

  1. Room volume: length × width × ceiling height.
  2. 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.
  3. Bare log walls: the room volume is multiplied by 1.5 (Harvia).
  4. 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.
  5. 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.

Properties

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.

Page variables

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()).

The temperature converter

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).

Properties

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().

Several tools on one page

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"

Customizing

  • Look: every rule in assets/css/saunatools.css is scoped to .st. Change the colors with the custom properties --st-ink, --st-muted, --st-line, --st-surface, --st-accent, --st-accent-ink, --st-error and --st-radius, or set loadCss to false and write your own styles.
  • Markup: override a partial in your theme, as with any component: copy the plugin's components/heatercalculator/default.htm to partials/<alias>/default.htm in the theme (for example partials/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 the boot() method of your own plugin. The keys are in classes/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).

Tests

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.

License

MIT. See LICENSE.

About

Sauna heater size calculator and °F/°C converter components for October CMS 3.x/4.x. No JavaScript, MIT.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages