A system can include a bed having a mattress, a sensor, and the data processing device. The sensor is configured to sense a feature of the mattress and transmit readings to a data processing device. The data processing device includes a processor and is configured to receive the readings from the sensor and determine if the readings i) indicate a user presence on the mattress and ii) indicate the user intends to sleep. The data processing device is configured to transmit a command to a peripheral controller responsive to determining that the readings i) indicate user presence on the mattress and ii) indicate the user intends to sleep.