Skip to content

Conversation

@ahrmn
Copy link

@ahrmn ahrmn commented Dec 23, 2025

I reverse-engineered the settings of the Meter Pro (CO2) and implemented them here.
I have no means of testing if this work for the other Meter models.
An example script to fully configure a device using this would be for example

import asyncio

from switchbot.devices.meter import SwitchbotMeter
from switchbot.discovery import GetSwitchbotDevices
from switchbot.const import SwitchbotModel

BLE_MAC='XX:XX:XX:XX:XX:XX'
METER_MODEL=SwitchbotModel.METER_PRO_C

async def main():
    switchbotDevices = await GetSwitchbotDevices().discover()
    meter_advertisement = switchbotDevices[BLE_MAC]
    print(meter_advertisement.data)
    meter = SwitchbotMeter(device=meter_advertisement.device, model=METER_MODEL)
    await meter.sync_time()
    await meter.show_battery_level(False)
    await meter.set_date_format(True)
    await meter.set_time_format(True)
    await meter.set_co2_thresholds(900, 1200)
    await meter.set_comfortlevel(19, 22, 40, 70)
    await meter.set_temperature_update_interval(10)
    await meter.set_co2_update_interval(10)
    await meter.set_button_function(False, False)
    await meter.set_alert_sound(False, 2)
    await meter.set_alert_temperature_humidity(True, 17, 28, False,
                                               True, 40, 70, False)
    await meter.set_alert_co2(True, 400, 1200, False)
    
asyncio.run(main())

Additionally one can trigger a new measurement regardless of the frequency using
await meter.force_new_CO2_measurement() and calibrate the sensor (at fresh air!) using
await meter.calibrate_co2_sensor().

@ahrmn
Copy link
Author

ahrmn commented Dec 23, 2025

This may solve #416.
@jacekowski Can you test if this synchronises time for the Meter Pro (without CO2 sensor)?


COMMAND_BUTTON_FUNCTION = f"{SETTINGS_HEADER}070106"
COMMAND_CALIBRATE_CO2_SENSOR = f"{SETTINGS_HEADER}0b02"
COMMAND_SYNC_TIME = "570005030d00000000"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note that this command might be insufficient or incomplete:

  1. It sends a hardcoded timezone 0d, which is UTC+1 - this might be insufficient/confusing for users outside of that area.
  2. It treats the timestamp as int32 instead of int64 (all those zeroes).

I also goofed around with this device and put together #433 that focuses just on datetime functionality - please take a look, I guess we can collaborate here :)

Copy link
Author

@ahrmn ahrmn Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I admit that I didn't think about timezones.
When your PR gets merged I'll happily remove my time-code and integrate the rest into your structure.

@zerzhang
Copy link
Collaborator

zerzhang commented Jan 7, 2026

Additional unit tests are needed. It is recommended to create a base class MeterPro and move the CO2 settings to a separate class MeterProCO2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants