async def METHOD_NAME(config):
    var = cg.new_Pvariable(config[CONF_ID])
    await cg.register_component(var, config)
    await modbus.register_modbus_device(var, config)
    if CONF_TOTAL_POWER in config:
        sens = await sensor.new_sensor(config[CONF_TOTAL_POWER])
        cg.add(var.set_total_power_sensor(sens))
    if CONF_FREQUENCY in config:
        sens = await sensor.new_sensor(config[CONF_FREQUENCY])
        cg.add(var.set_frequency_sensor(sens))
    if CONF_IMPORT_ACTIVE_ENERGY in config:
        sens = await sensor.new_sensor(config[CONF_IMPORT_ACTIVE_ENERGY])
        cg.add(var.set_import_active_energy_sensor(sens))
    if CONF_EXPORT_ACTIVE_ENERGY in config:
        sens = await sensor.new_sensor(config[CONF_EXPORT_ACTIVE_ENERGY])
        cg.add(var.set_export_active_energy_sensor(sens))
    if CONF_IMPORT_REACTIVE_ENERGY in config:
        sens = await sensor.new_sensor(config[CONF_IMPORT_REACTIVE_ENERGY])
        cg.add(var.set_import_reactive_energy_sensor(sens))
    if CONF_EXPORT_REACTIVE_ENERGY in config:
        sens = await sensor.new_sensor(config[CONF_EXPORT_REACTIVE_ENERGY])
        cg.add(var.set_export_reactive_energy_sensor(sens))
    for i, phase in enumerate([CONF_PHASE_A, CONF_PHASE_B, CONF_PHASE_C]):
        if phase not in config:
            continue
        phase_config = config[phase]
        for sensor_type in PHASE_SENSORS:
            if sensor_type in phase_config:
                sens = await sensor.new_sensor(phase_config[sensor_type])
                cg.add(getattr(var, f"set_{sensor_type}_sensor")(i, sens))