Skip to content
Get started

DS3231 Binary Sensor

The ds3231 binary sensor platform reports the alarm flags and the oscillator-stop flag of a DS3231 real-time clock.

Set up the ds3231 hub (and the I²C bus it needs) first.

# Example configuration entry
binary_sensor:
- platform: ds3231
alarm_1:
name: "RTC Alarm 1"
alarm_2:
name: "RTC Alarm 2"
oscillator_stopped:
name: "RTC Oscillator Stopped"
  • ds3231_id (Optional, ID): The ID of the ds3231 hub to use when more than one is configured.
  • alarm_1 (Optional): On when alarm 1 fires. All options from Binary Sensor.
  • alarm_2 (Optional): On when alarm 2 fires. All options from Binary Sensor.
  • oscillator_stopped (Optional): On when the chip’s oscillator has stopped since the time was last written, which means the stored time is invalid (usually an empty or missing backup battery). Turns off after ds3231.write_time. All options from Binary Sensor.

With auto_clear_alarms: true (the default), an alarm sensor turns on for one second each time the alarm fires. With auto_clear_alarms: false, it stays on until the alarm is cleared with the ds3231.clear_alarm action.

Only enabled alarms turn their sensor on. The alarm sensors start off at boot; an alarm that fired while the device was off is reported right after boot. The flags are read on the hub’s interrupt_pin and every alarm_check_interval.