← Back to help

Rules and automation

Rules tell Optimaatti when a device may run. Start with one simple rule per device.

Check these before you start

  • Device appears in Optimaatti and is online.
  • Device type and purpose are set (e.g. heating / lighting / outlet).
  • If the device is a heater: nominal power (W) is reasonable.
  • If control depends on temperature: a temperature sensor is selected and data is visible.

Choose the right rule like this

Choose a price rule if:

  • you want to move usage to the cheapest hours
  • the device does not need tight temperature comfort

Choose a schedule rule if:

  • the device should run only at certain times or on certain days
  • control is a simple on/off routine

Choose temperature-based control or MPC if:

  • comfort matters, such as with heating
  • you want price and temperature to work together sensibly

If your goal is the best possible heating control, see Predictive control (MPC) - Help.

The most important rule at the start

The easiest way to avoid problems is simple: use one rule per device at first. Add a second rule only when you know exactly why you need it.

  • One device + one rule is the best starting point.
  • Multiple rules can conflict if they try to control the same device in different ways.
  • If you need both price logic and time limits, first try limiting one rule to the correct time window.

Price-based rules

Control devices based on electricity price

Cheapest X hours per day

Device runs during the cheapest X hours in a 24h period

Good for: water heater, floor heating, garage

When price below Y c/kWh

Device runs when price drops below a threshold

Good for: water heater, floor heating

Cheapest X hours within a window

Device runs during the cheapest X hours within a time window (e.g. 06:00-22:00)

Good for: lighting, water heater

Schedule rules

Control devices based on time

Daily schedule

Device turns on/off at specific times every day

Good for: lighting, heating

Weekday schedule

Different schedule for different weekdays

Good for: weekdays vs weekends

Combined: schedule + price

Run during cheapest hours within a time window

Good for: maximize savings while limiting runtime

Temperature rules

Control heating based on temperature and price

Predictive control (MPC)

Predictive control plans heating for ~48 hours ahead

Good for: floor heating, heat pump

Temperature + price

Heat when temperature is low AND price is low

Good for: smart heating control

Target temperature

Maintain a target range while optimizing cost

Good for: comfort + savings

Tips for creating rules

1

Start simple

Create one simple rule first (e.g. "Cheapest 3 hours per day") and test it.

2

Use time limits

Restrict rules to certain times (e.g. 06:00-22:00) to avoid night-time starts.

3

Combine rules carefully

You can have multiple rules, but priority matters.

4

Monitor results

Check savings regularly and adjust rules as needed.

5

Test first

Test new rules for a few days before relying on them long-term.

Testing and rollout (recommended)

Use this order (minimize risk)

  1. Create a rule for one device.
  2. Check the timeline/device state: does it switch at the right times?
  3. Let it run 1–3 days and monitor cost and state history.
  4. Fine-tune (hours, thresholds, windows) before copying to other devices.

Tip: Offline scheduling

If your device supports offline scheduling, enable it so schedules work during outages.

Read about offline scheduling

Troubleshooting & FAQ (rules)

Problem: the rule does nothing

  • confirm the rule is saved and enabled
  • confirm the device is online and the correct output/channel is selected
  • confirm time windows do not exclude everything
  • check if another rule overrides this one (priority / forcing)

Problem: device turns on at the wrong time

  • a price rule may pick cheap night hours — add a time window (e.g. 06–22)
  • confirm timezone and times are correct
  • check if another rule wins (e.g. schedule rule)

Problem: device toggles too often

  • use longer blocks (e.g. cheapest 3 hours) instead of sensitive thresholds
  • avoid rules that flip state too frequently
  • for heating, consider Predictive control for smoother control

How do I see what the rule did?

  • check device state history / timeline (15 min)
  • check logs if you have access
Read about device state history

Concrete examples (start with these)

  • Water heater: Cheapest 3–6 hours per day + time window (e.g. 00–07 or 22–08).
  • Electric radiator (comfort not critical): When price below threshold + time window (e.g. 06–22).
  • Lights: schedule + sensor/room (if used) or ?on at 16, off at 23?.

How do I create a rule?

1

Open Rules

Find it from the main menu.

2

Click "Create new rule"

Choose Wizard mode (recommended) or Advanced mode.

3

Select device and output

Choose the device and which channel/output to control.

4

Choose a template

Select a ready template or create a custom rule.

5

Fine-tune settings

Wizard asks only essentials (hours, thresholds, time windows, weekdays).

6

Save

The rule becomes active automatically.

Wizard mode in a nutshell

Wizard mode is available in the rule creation view. Advanced mode shows all fields at once.

Wizard splits rule creation into small steps. You choose a goal and fill key parameters.

  • Price rules: choose a template and set hours or threshold.
  • Schedule rules: define times and weekdays.
  • Temperature rules: choose a target or combined model and start with sensible defaults.

After using Wizard, you can always open the rule later and adjust details. Wizard helps you start, editor gives full control.

How do AI assistants help?

AI assistants can read your existing rules and explain how they work, risks and improvements.

You can ask AI to draft a new rule by describing your goal. Review before saving.

You are always responsible: review, test and save only when satisfied.

helpIndexPage.helpTitle

helpIndexPage.helpLead