Skip to content

AC Auto

Main menu key: n

Uses a Mijia BLE temperature/humidity sensor to auto-send IR power-on / power-off for an air conditioner. Settings live in the ac_auto object in config.json, editable in on-device Options or Config Web (/ac-auto).

Screenshots

acauto-stopacauto-autoacauto-onacauto-config

Prerequisites

  1. Add the HT sensor in Config Web → Devices (model contains sensor_ht / .ht.) with a valid ble.key.
  2. Aim the IR emitter at the AC receiver; brands match Infrared AC protocols (try another brand if no response).
  3. Configure ac_auto: sensor, on_temp / off_temp, filter, and AC brand / mode / temp / fan.

Shortcuts

KeyAction
tStart / stop AUTO
cDisplay ↔ on-device config
s / BtnABlank screen; any key or BtnA wakes
rReset on / off streak counters
pToggle assumed AC on / off (icon only, no IR)
hHelp (3 pages: keys / params / how it runs)
, . [ ]Flip Help pages
Config ; .Move row
Config - =Change value

Back to menu: on the display page, ESC / GO. On the config page, ESC / GO closes config first; press again to leave the app.

How it runs

On enter, the app listens to BLE on a duty cycle (whether AUTO is on or not) and updates temperature / humidity plus a ~12-hour chart whenever a reading arrives.

The app does not sense the real AC power state; on enter it assumes off. If the AC is already on, press p to mark the power icon ON so a later cold reading can send IR off.

IR is sent only after you press t and AUTO is active:

ConditionAction
Temp > on_temp for filter consecutive readings, AC considered offIR power on (configured mode / temp / fan)
Temp < off_temp for filter consecutive readings, AC considered onIR power off
Temp between off_temp and on_tempClear on / off streaks (hysteresis)

Example defaults: on_temp=29, off_temp=26, filter=3 → open only after three readings above 29°C; close only after three below 26°C.

BLE duty cycle

Many HT meters advertise every few minutes. In-app:

  • Listen up to about 6 minutes per round
  • After a valid reading, nap about 4 minutes
  • Briefly keep listening after the first packet so filter can accumulate

Display

  • Top: AUTO state, battery, BLE listen indicator
  • Left: temp / humidity; right: on / off counts and AC power icon
  • Chart: temperature trace with on / off threshold lines

Config fields (ac_auto)

FieldMeaningTypical range
sensor_idHT device idMust match devices[]
on_tempOpen AC when above (°C)16–40, default 29
off_tempClose AC when below (°C)10–35, default 26
filterConsecutive hits before action1–10, default 3
ac_brandIR AC brandmidea / gree / …
ac_modePower-on modecool / heat / dry / fan / auto
ac_tempSetpoint (°C)16–30
ac_fanFan speedauto / min / low / med / high / max

The Config Web /ac-auto page repeats this mechanism text under the settings form.

Sparks for M5Stack Cardputer